(function (){ 'use strict'; if(navigator.userAgent.match(/IEMobile\/10\.0/)){ var msViewportStyle=document.createElement('style') msViewportStyle.appendChild(document.createTextNode('@-ms-viewport{width:auto!important}' ) ) document.querySelector('head').appendChild(msViewportStyle) }})(); !function(t){t.slidebars=function(s){function e(){!c.disableOver||"number"==typeof c.disableOver&&c.disableOver>=k?(w=!0,t("html").addClass("sb-init"),c.hideControlClasses&&T.removeClass("sb-hide"),i()):"number"==typeof c.disableOver&&c.disableOvers&&g.css("minHeight",t("html").css("height")),m&&m.hasClass("sb-width-custom")&&m.css("width",m.attr("data-sb-width")),C&&C.hasClass("sb-width-custom")&&C.css("width",C.attr("data-sb-width")),m&&(m.hasClass("sb-style-push")||m.hasClass("sb-style-overlay"))&&m.css("marginLeft","-"+m.css("width")),C&&(C.hasClass("sb-style-push")||C.hasClass("sb-style-overlay"))&&C.css("marginRight","-"+C.css("width")),c.scrollLock&&t("html").addClass("sb-scroll-lock")}function n(t,s,e){function n(){a.removeAttr("style"),i()}var a;if(a=t.hasClass("sb-style-push")?g.add(t).add(O):t.hasClass("sb-style-overlay")?t:g.add(O),"translate"===x)"0px"===s?n():a.css("transform","translate("+s+")");else if("side"===x)"0px"===s?n():("-"===s[0]&&(s=s.substr(1)),a.css(e,"0px"),setTimeout(function(){a.css(e,s)},1));else if("jQuery"===x){"-"===s[0]&&(s=s.substr(1));var o={};o[e]=s,a.stop().animate(o,400)}}function a(s){function e(){w&&"left"===s&&m?(t("html").addClass("sb-active sb-active-left"),m.addClass("sb-active"),n(m,m.css("width"),"left"),setTimeout(function(){p=!0},400)):w&&"right"===s&&C&&(t("html").addClass("sb-active sb-active-right"),C.addClass("sb-active"),n(C,"-"+C.css("width"),"right"),setTimeout(function(){y=!0},400))}"left"===s&&m&&y||"right"===s&&C&&p?(o(),setTimeout(e,400)):e()}function o(s,e){(p||y)&&(p&&(n(m,"0px","left"),p=!1),y&&(n(C,"0px","right"),y=!1),setTimeout(function(){t("html").removeClass("sb-active sb-active-left sb-active-right"),m&&m.removeClass("sb-active"),C&&C.removeClass("sb-active"),"undefined"!=typeof s&&(void 0===typeof e&&(e="_self"),window.open(s,e))},400))}function l(t){"left"===t&&m&&(p?o():a("left")),"right"===t&&C&&(y?o():a("right"))}function r(t,s){t.stopPropagation(),t.preventDefault(),"touchend"===t.type&&s.off("click")}var c=t.extend({siteClose:!0,scrollLock:!1,disableOver:!1,hideControlClasses:!1},s),h=document.createElement("div").style,d=!1,f=!1;(""===h.MozTransition||""===h.WebkitTransition||""===h.OTransition||""===h.transition)&&(d=!0),(""===h.MozTransform||""===h.WebkitTransform||""===h.OTransform||""===h.transform)&&(f=!0);var u=navigator.userAgent,b=!1,v=!1;/Android/.test(u)?b=u.substr(u.indexOf("Android")+8,3):/(iPhone|iPod|iPad)/.test(u)&&(v=u.substr(u.indexOf("OS ")+3,3).replace("_",".")),(b&&3>b||v&&5>v)&&t("html").addClass("sb-static");var g=t("#sb-site, .sb-site-container");if(t(".sb-left").length)var m=t(".sb-left"),p=!1;if(t(".sb-right").length)var C=t(".sb-right"),y=!1;var w=!1,k=t(window).width(),T=t(".sb-toggle-left, .sb-toggle-right, .sb-open-left, .sb-open-right, .sb-close"),O=t(".sb-slide");e(),t(window).resize(function(){var s=t(window).width();k!==s&&(k=s,e(),p&&a("left"),y&&a("right"))});var x;d&&f?(x="translate",b&&4.4>b&&(x="side")):x="jQuery",this.slidebars={open:a,close:o,toggle:l,init:function(){return w},active:function(t){return"left"===t&&m?p:"right"===t&&C?y:void 0},destroy:function(t){"left"===t&&m&&(p&&o(),setTimeout(function(){m.remove(),m=!1},400)),"right"===t&&C&&(y&&o(),setTimeout(function(){C.remove(),C=!1},400))}},t(".sb-toggle-left").on("touchend click",function(s){r(s,t(this)),l("left")}),t(".sb-toggle-right").on("touchend click",function(s){r(s,t(this)),l("right")}),t(".sb-open-left").on("touchend click",function(s){r(s,t(this)),a("left")}),t(".sb-open-right").on("touchend click",function(s){r(s,t(this)),a("right")}),t(".sb-close").on("touchend click",function(s){if(t(this).is("a")||t(this).children().is("a")){if("click"===s.type){s.stopPropagation(),s.preventDefault();var e=t(this).is("a")?t(this):t(this).find("a"),i=e.attr("href"),n=e.attr("target")?e.attr("target"):"_self";o(i,n)}}else r(s,t(this)),o()}),g.on("touchend click",function(s){c.siteClose&&(p||y)&&(r(s,t(this)),o())})}}(jQuery); if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); ;(function($){ var plugin={}; var defaults={ mode: 'horizontal', slideSelector: '', infiniteLoop: true, hideControlOnEnd: false, speed: 500, easing: null, slideMargin: 0, startSlide: 0, randomStart: false, captions: false, ticker: false, tickerHover: false, adaptiveHeight: false, adaptiveHeightSpeed: 500, video: false, useCSS: true, preloadImages: 'visible', responsive: true, slideZIndex: 50, wrapperClass: 'bx-wrapper', touchEnabled: true, swipeThreshold: 50, oneToOneTouch: true, preventDefaultSwipeX: true, preventDefaultSwipeY: false, pager: true, pagerType: 'full', pagerShortSeparator: ' / ', pagerSelector: null, buildPager: null, pagerCustom: null, controls: true, nextText: 'Next', prevText: 'Prev', nextSelector: null, prevSelector: null, autoControls: false, startText: 'Start', stopText: 'Stop', autoControlsCombine: false, autoControlsSelector: null, auto: false, pause: 4000, autoStart: true, autoDirection: 'next', autoHover: false, autoDelay: 0, autoSlideForOnePage: false, minSlides: 1, maxSlides: 1, moveSlides: 0, slideWidth: 0, onSliderLoad: function(){}, onSlideBefore: function(){}, onSlideAfter: function(){}, onSlideNext: function(){}, onSlidePrev: function(){}, onSliderResize: function(){}} $.fn.bxSlider=function(options){ if(this.length==0) return this; if(this.length > 1){ this.each(function(){$(this).bxSlider(options)}); return this; } var slider={}; var el=this; plugin.el=this; var windowWidth=$(window).width(); var windowHeight=$(window).height(); var init=function(){ slider.settings=$.extend({}, defaults, options); slider.settings.slideWidth=parseInt(slider.settings.slideWidth); slider.children=el.children(slider.settings.slideSelector); if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides=slider.children.length; if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides=slider.children.length; if(slider.settings.randomStart) slider.settings.startSlide=Math.floor(Math.random() * slider.children.length); slider.active={ index: slider.settings.startSlide } slider.carousel=slider.settings.minSlides > 1||slider.settings.maxSlides > 1; if(slider.carousel) slider.settings.preloadImages='all'; slider.minThreshold=(slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin); slider.maxThreshold=(slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); slider.working=false; slider.controls={}; slider.interval=null; slider.animProp=slider.settings.mode=='vertical' ? 'top':'left'; slider.usingCSS=slider.settings.useCSS&&slider.settings.mode!='fade'&&(function(){ var div=document.createElement('div'); var props=['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; for(var i in props){ if(div.style[props[i]]!==undefined){ slider.cssPrefix=props[i].replace('Perspective', '').toLowerCase(); slider.animProp='-' + slider.cssPrefix + '-transform'; return true; }} return false; }()); if(slider.settings.mode=='vertical') slider.settings.maxSlides=slider.settings.minSlides; el.data("origStyle", el.attr("style")); el.children(slider.settings.slideSelector).each(function(){ $(this).data("origStyle", $(this).attr("style")); }); setup(); } var setup=function(){ el.wrap('
'); slider.viewport=el.parent(); slider.loader=$('
'); slider.viewport.prepend(slider.loader); el.css({ width: slider.settings.mode=='horizontal' ? (slider.children.length * 100 + 215) + '%':'auto', position: 'relative' }); if(slider.usingCSS&&slider.settings.easing){ el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing); }else if(!slider.settings.easing){ slider.settings.easing='swing'; } var slidesShowing=getNumberSlidesShowing(); slider.viewport.css({ width: '100%', overflow: 'hidden', position: 'relative' }); slider.viewport.parent().css({ maxWidth: getViewportMaxWidth() }); if(!slider.settings.pager){ slider.viewport.parent().css({ margin: '0 auto 0px' }); } slider.children.css({ 'float': slider.settings.mode=='horizontal' ? 'left':'none', listStyle: 'none', position: 'relative' }); slider.children.css('width', getSlideWidth()); if(slider.settings.mode=='horizontal'&&slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin); if(slider.settings.mode=='vertical'&&slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin); if(slider.settings.mode=='fade'){ slider.children.css({ position: 'absolute', zIndex: 0, display: 'none' }); slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'}); } slider.controls.el=$('
'); if(slider.settings.captions) appendCaptions(); slider.active.last=slider.settings.startSlide==getPagerQty() - 1; if(slider.settings.video) el.fitVids(); var preloadSelector=slider.children.eq(slider.settings.startSlide); if(slider.settings.preloadImages=="all") preloadSelector=slider.children; if(!slider.settings.ticker){ if(slider.settings.pager) appendPager(); if(slider.settings.controls) appendControls(); if(slider.settings.auto&&slider.settings.autoControls) appendControlsAuto(); if(slider.settings.controls||slider.settings.autoControls||slider.settings.pager) slider.viewport.after(slider.controls.el); }else{ slider.settings.pager=false; } loadElements(preloadSelector, start); } var loadElements=function(selector, callback){ var total=selector.find('img, iframe').length; if(total==0){ callback(); return; } var count=0; selector.find('img, iframe').each(function(){ $(this).one('load', function(){ if(++count==total) callback(); }).each(function(){ if(this.complete) $(this).load(); }); }); } var start=function(){ if(slider.settings.infiniteLoop&&slider.settings.mode!='fade'&&!slider.settings.ticker){ var slice=slider.settings.mode=='vertical' ? slider.settings.minSlides:slider.settings.maxSlides; var sliceAppend=slider.children.slice(0, slice).clone().addClass('bx-clone'); var slicePrepend=slider.children.slice(-slice).clone().addClass('bx-clone'); el.append(sliceAppend).prepend(slicePrepend); } slider.loader.remove(); setSlidePosition(); if(slider.settings.mode=='vertical') slider.settings.adaptiveHeight=true; slider.viewport.height(getViewportHeight()); el.redrawSlider(); slider.settings.onSliderLoad(slider.active.index); slider.initialized=true; if(slider.settings.responsive) $(window).bind('resize', resizeWindow); if(slider.settings.auto&&slider.settings.autoStart&&(getPagerQty() > 1||slider.settings.autoSlideForOnePage)) initAuto(); if(slider.settings.ticker) initTicker(); if(slider.settings.pager) updatePagerActive(slider.settings.startSlide); if(slider.settings.controls) updateDirectionControls(); if(slider.settings.touchEnabled&&!slider.settings.ticker) initTouch(); } var getViewportHeight=function(){ var height=0; var children=$(); if(slider.settings.mode!='vertical'&&!slider.settings.adaptiveHeight){ children=slider.children; }else{ if(!slider.carousel){ children=slider.children.eq(slider.active.index); }else{ var currentIndex=slider.settings.moveSlides==1 ? slider.active.index:slider.active.index * getMoveBy(); children=slider.children.eq(currentIndex); for (i=1; i <=slider.settings.maxSlides - 1; i++){ if(currentIndex + i >=slider.children.length){ children=children.add(slider.children.eq(i - 1)); }else{ children=children.add(slider.children.eq(currentIndex + i)); }} }} if(slider.settings.mode=='vertical'){ children.each(function(index){ height +=$(this).outerHeight(); }); if(slider.settings.slideMargin > 0){ height +=slider.settings.slideMargin * (slider.settings.minSlides - 1); }}else{ height=Math.max.apply(Math, children.map(function(){ return $(this).outerHeight(false); }).get()); } if(slider.viewport.css('box-sizing')=='border-box'){ height +=parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) + parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width')); }else if(slider.viewport.css('box-sizing')=='padding-box'){ height +=parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')); } return height; } var getViewportMaxWidth=function(){ var width='100%'; if(slider.settings.slideWidth > 0){ if(slider.settings.mode=='horizontal'){ width=(slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin); }else{ width=slider.settings.slideWidth; }} return width; } var getSlideWidth=function(){ var newElWidth=slider.settings.slideWidth; var wrapWidth=slider.viewport.width(); if(slider.settings.slideWidth==0 || (slider.settings.slideWidth > wrapWidth&&!slider.carousel) || slider.settings.mode=='vertical'){ newElWidth=wrapWidth; }else if(slider.settings.maxSlides > 1&&slider.settings.mode=='horizontal'){ if(wrapWidth > slider.maxThreshold){ }else if(wrapWidth < slider.minThreshold){ newElWidth=(wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides; }} return newElWidth; } var getNumberSlidesShowing=function(){ var slidesShowing=1; if(slider.settings.mode=='horizontal'&&slider.settings.slideWidth > 0){ if(slider.viewport.width() < slider.minThreshold){ slidesShowing=slider.settings.minSlides; }else if(slider.viewport.width() > slider.maxThreshold){ slidesShowing=slider.settings.maxSlides; }else{ var childWidth=slider.children.first().width() + slider.settings.slideMargin; slidesShowing=Math.floor((slider.viewport.width() + slider.settings.slideMargin) / childWidth); }}else if(slider.settings.mode=='vertical'){ slidesShowing=slider.settings.minSlides; } return slidesShowing; } var getPagerQty=function(){ var pagerQty=0; if(slider.settings.moveSlides > 0){ if(slider.settings.infiniteLoop){ pagerQty=Math.ceil(slider.children.length / getMoveBy()); }else{ var breakPoint=0; var counter=0 while (breakPoint < slider.children.length){ ++pagerQty; breakPoint=counter + getNumberSlidesShowing(); counter +=slider.settings.moveSlides <=getNumberSlidesShowing() ? slider.settings.moveSlides:getNumberSlidesShowing(); }} }else{ pagerQty=Math.ceil(slider.children.length / getNumberSlidesShowing()); } return pagerQty; } var getMoveBy=function(){ if(slider.settings.moveSlides > 0&&slider.settings.moveSlides <=getNumberSlidesShowing()){ return slider.settings.moveSlides; } return getNumberSlidesShowing(); } var setSlidePosition=function(){ if(slider.children.length > slider.settings.maxSlides&&slider.active.last&&!slider.settings.infiniteLoop){ if(slider.settings.mode=='horizontal'){ var lastChild=slider.children.last(); var position=lastChild.position(); setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0); }else if(slider.settings.mode=='vertical'){ var lastShowingIndex=slider.children.length - slider.settings.minSlides; var position=slider.children.eq(lastShowingIndex).position(); setPositionProperty(-position.top, 'reset', 0); }}else{ var position=slider.children.eq(slider.active.index * getMoveBy()).position(); if(slider.active.index==getPagerQty() - 1) slider.active.last=true; if(position!=undefined){ if(slider.settings.mode=='horizontal') setPositionProperty(-position.left, 'reset', 0); else if(slider.settings.mode=='vertical') setPositionProperty(-position.top, 'reset', 0); }} } var setPositionProperty=function(value, type, duration, params){ if(slider.usingCSS){ var propValue=slider.settings.mode=='vertical' ? 'translate3d(0, ' + value + 'px, 0)':'translate3d(' + value + 'px, 0, 0)'; el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's'); if(type=='slide'){ el.css(slider.animProp, propValue); el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); updateAfterSlideTransition(); }); }else if(type=='reset'){ el.css(slider.animProp, propValue); }else if(type=='ticker'){ el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear'); el.css(slider.animProp, propValue); el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){ el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'); setPositionProperty(params['resetValue'], 'reset', 0); tickerLoop(); }); }}else{ var animateObj={}; animateObj[slider.animProp]=value; if(type=='slide'){ el.animate(animateObj, duration, slider.settings.easing, function(){ updateAfterSlideTransition(); }); }else if(type=='reset'){ el.css(slider.animProp, value) }else if(type=='ticker'){ el.animate(animateObj, speed, 'linear', function(){ setPositionProperty(params['resetValue'], 'reset', 0); tickerLoop(); }); }} } var populatePager=function(){ var pagerHtml=''; var pagerQty=getPagerQty(); for(var i=0; i < pagerQty; i++){ var linkContent=''; if(slider.settings.buildPager&&$.isFunction(slider.settings.buildPager)){ linkContent=slider.settings.buildPager(i); slider.pagerEl.addClass('bx-custom-pager'); }else{ linkContent=i + 1; slider.pagerEl.addClass('bx-default-pager'); } pagerHtml +=''; }; slider.pagerEl.html(pagerHtml); } var appendPager=function(){ if(!slider.settings.pagerCustom){ slider.pagerEl=$('
'); if(slider.settings.pagerSelector){ $(slider.settings.pagerSelector).html(slider.pagerEl); }else{ slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl); } populatePager(); }else{ slider.pagerEl=$(slider.settings.pagerCustom); } slider.pagerEl.on('click', 'a', clickPagerBind); } var appendControls=function(){ slider.controls.next=$('' + slider.settings.nextText + ''); slider.controls.prev=$('' + slider.settings.prevText + ''); slider.controls.next.bind('click', clickNextBind); slider.controls.prev.bind('click', clickPrevBind); if(slider.settings.nextSelector){ $(slider.settings.nextSelector).append(slider.controls.next); } if(slider.settings.prevSelector){ $(slider.settings.prevSelector).append(slider.controls.prev); } if(!slider.settings.nextSelector&&!slider.settings.prevSelector){ slider.controls.directionEl=$('
'); slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next); slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl); }} var appendControlsAuto=function(){ slider.controls.start=$(''); slider.controls.stop=$(''); slider.controls.autoEl=$('
'); slider.controls.autoEl.on('click', '.bx-start', clickStartBind); slider.controls.autoEl.on('click', '.bx-stop', clickStopBind); if(slider.settings.autoControlsCombine){ slider.controls.autoEl.append(slider.controls.start); }else{ slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop); } if(slider.settings.autoControlsSelector){ $(slider.settings.autoControlsSelector).html(slider.controls.autoEl); }else{ slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl); } updateAutoControls(slider.settings.autoStart ? 'stop':'start'); } var appendCaptions=function(){ slider.children.each(function(index){ var title=$(this).find('img:first').attr('title'); if(title!=undefined&&('' + title).length){ $(this).append('
' + title + '
'); }}); } var clickNextBind=function(e){ if(slider.settings.auto) el.stopAuto(); el.goToNextSlide(); e.preventDefault(); } var clickPrevBind=function(e){ if(slider.settings.auto) el.stopAuto(); el.goToPrevSlide(); e.preventDefault(); } var clickStartBind=function(e){ el.startAuto(); e.preventDefault(); } var clickStopBind=function(e){ el.stopAuto(); e.preventDefault(); } var clickPagerBind=function(e){ if(slider.settings.auto) el.stopAuto(); var pagerLink=$(e.currentTarget); if(pagerLink.attr('data-slide-index')!==undefined){ var pagerIndex=parseInt(pagerLink.attr('data-slide-index')); if(pagerIndex!=slider.active.index) el.goToSlide(pagerIndex); e.preventDefault(); }} var updatePagerActive=function(slideIndex){ var len=slider.children.length; if(slider.settings.pagerType=='short'){ if(slider.settings.maxSlides > 1){ len=Math.ceil(slider.children.length/slider.settings.maxSlides); } slider.pagerEl.html((slideIndex + 1) + slider.settings.pagerShortSeparator + len); return; } slider.pagerEl.find('a').removeClass('active'); slider.pagerEl.each(function(i, el){ $(el).find('a').eq(slideIndex).addClass('active'); }); } var updateAfterSlideTransition=function(){ if(slider.settings.infiniteLoop){ var position=''; if(slider.active.index==0){ position=slider.children.eq(0).position(); }else if(slider.active.index==getPagerQty() - 1&&slider.carousel){ position=slider.children.eq((getPagerQty() - 1) * getMoveBy()).position(); }else if(slider.active.index==slider.children.length - 1){ position=slider.children.eq(slider.children.length - 1).position(); } if(position){ if(slider.settings.mode=='horizontal'){ setPositionProperty(-position.left, 'reset', 0); } else if(slider.settings.mode=='vertical'){ setPositionProperty(-position.top, 'reset', 0); }} } slider.working=false; slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); } var updateAutoControls=function(state){ if(slider.settings.autoControlsCombine){ slider.controls.autoEl.html(slider.controls[state]); }else{ slider.controls.autoEl.find('a').removeClass('active'); slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active'); }} var updateDirectionControls=function(){ if(getPagerQty()==1){ slider.controls.prev.addClass('disabled'); slider.controls.next.addClass('disabled'); }else if(!slider.settings.infiniteLoop&&slider.settings.hideControlOnEnd){ if(slider.active.index==0){ slider.controls.prev.addClass('disabled'); slider.controls.next.removeClass('disabled'); }else if(slider.active.index==getPagerQty() - 1){ slider.controls.next.addClass('disabled'); slider.controls.prev.removeClass('disabled'); }else{ slider.controls.prev.removeClass('disabled'); slider.controls.next.removeClass('disabled'); }} } var initAuto=function(){ if(slider.settings.autoDelay > 0){ var timeout=setTimeout(el.startAuto, slider.settings.autoDelay); }else{ el.startAuto(); } if(slider.settings.autoHover){ el.hover(function(){ if(slider.interval){ el.stopAuto(true); slider.autoPaused=true; }}, function(){ if(slider.autoPaused){ el.startAuto(true); slider.autoPaused=null; }}); }} var initTicker=function(){ var startPosition=0; if(slider.settings.autoDirection=='next'){ el.append(slider.children.clone().addClass('bx-clone')); }else{ el.prepend(slider.children.clone().addClass('bx-clone')); var position=slider.children.first().position(); startPosition=slider.settings.mode=='horizontal' ? -position.left:-position.top; } setPositionProperty(startPosition, 'reset', 0); slider.settings.pager=false; slider.settings.controls=false; slider.settings.autoControls=false; if(slider.settings.tickerHover&&!slider.usingCSS){ slider.viewport.hover(function(){ el.stop(); }, function(){ var totalDimens=0; slider.children.each(function(index){ totalDimens +=slider.settings.mode=='horizontal' ? $(this).outerWidth(true):$(this).outerHeight(true); }); var ratio=slider.settings.speed / totalDimens; var property=slider.settings.mode=='horizontal' ? 'left':'top'; var newSpeed=ratio * (totalDimens - (Math.abs(parseInt(el.css(property))))); tickerLoop(newSpeed); }); } tickerLoop(); } var tickerLoop=function(resumeSpeed){ speed=resumeSpeed ? resumeSpeed:slider.settings.speed; var position={left: 0, top: 0}; var reset={left: 0, top: 0}; if(slider.settings.autoDirection=='next'){ position=el.find('.bx-clone').first().position(); }else{ reset=slider.children.first().position(); } var animateProperty=slider.settings.mode=='horizontal' ? -position.left:-position.top; var resetValue=slider.settings.mode=='horizontal' ? -reset.left:-reset.top; var params={resetValue: resetValue}; setPositionProperty(animateProperty, 'ticker', speed, params); } var initTouch=function(){ slider.touch={ start: {x: 0, y: 0}, end: {x: 0, y: 0}} slider.viewport.bind('touchstart', onTouchStart); } var onTouchStart=function(e){ if(slider.working){ e.preventDefault(); }else{ slider.touch.originalPos=el.position(); var orig=e.originalEvent; slider.touch.start.x=orig.changedTouches[0].pageX; slider.touch.start.y=orig.changedTouches[0].pageY; slider.viewport.bind('touchmove', onTouchMove); slider.viewport.bind('touchend', onTouchEnd); }} var onTouchMove=function(e){ var orig=e.originalEvent; var xMovement=Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x); var yMovement=Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y); if((xMovement * 3) > yMovement&&slider.settings.preventDefaultSwipeX){ e.preventDefault(); }else if((yMovement * 3) > xMovement&&slider.settings.preventDefaultSwipeY){ e.preventDefault(); } if(slider.settings.mode!='fade'&&slider.settings.oneToOneTouch){ var value=0; if(slider.settings.mode=='horizontal'){ var change=orig.changedTouches[0].pageX - slider.touch.start.x; value=slider.touch.originalPos.left + change; }else{ var change=orig.changedTouches[0].pageY - slider.touch.start.y; value=slider.touch.originalPos.top + change; } setPositionProperty(value, 'reset', 0); }} var onTouchEnd=function(e){ slider.viewport.unbind('touchmove', onTouchMove); var orig=e.originalEvent; var value=0; slider.touch.end.x=orig.changedTouches[0].pageX; slider.touch.end.y=orig.changedTouches[0].pageY; if(slider.settings.mode=='fade'){ var distance=Math.abs(slider.touch.start.x - slider.touch.end.x); if(distance >=slider.settings.swipeThreshold){ slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide():el.goToPrevSlide(); el.stopAuto(); }}else{ var distance=0; if(slider.settings.mode=='horizontal'){ distance=slider.touch.end.x - slider.touch.start.x; value=slider.touch.originalPos.left; }else{ distance=slider.touch.end.y - slider.touch.start.y; value=slider.touch.originalPos.top; } if(!slider.settings.infiniteLoop&&((slider.active.index==0&&distance > 0)||(slider.active.last&&distance < 0))){ setPositionProperty(value, 'reset', 200); }else{ if(Math.abs(distance) >=slider.settings.swipeThreshold){ distance < 0 ? el.goToNextSlide():el.goToPrevSlide(); el.stopAuto(); }else{ setPositionProperty(value, 'reset', 200); }} } slider.viewport.unbind('touchend', onTouchEnd); } var resizeWindow=function(e){ if(!slider.initialized) return; var windowWidthNew=$(window).width(); var windowHeightNew=$(window).height(); if(windowWidth!=windowWidthNew||windowHeight!=windowHeightNew){ windowWidth=windowWidthNew; windowHeight=windowHeightNew; el.redrawSlider(); slider.settings.onSliderResize.call(el, slider.active.index); }} el.goToSlide=function(slideIndex, direction){ if(slider.working||slider.active.index==slideIndex) return; slider.working=true; slider.oldIndex=slider.active.index; if(slideIndex < 0){ slider.active.index=getPagerQty() - 1; }else if(slideIndex >=getPagerQty()){ slider.active.index=0; }else{ slider.active.index=slideIndex; } slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); if(direction=='next'){ slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); }else if(direction=='prev'){ slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index); } slider.active.last=slider.active.index >=getPagerQty() - 1; if(slider.settings.pager) updatePagerActive(slider.active.index); if(slider.settings.controls) updateDirectionControls(); if(slider.settings.mode=='fade'){ if(slider.settings.adaptiveHeight&&slider.viewport.height()!=getViewportHeight()){ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); } slider.children.filter(':visible').fadeOut(slider.settings.speed).css({zIndex: 0}); slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){ $(this).css('zIndex', slider.settings.slideZIndex); updateAfterSlideTransition(); }); }else{ if(slider.settings.adaptiveHeight&&slider.viewport.height()!=getViewportHeight()){ slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed); } var moveBy=0; var position={left: 0, top: 0}; if(!slider.settings.infiniteLoop&&slider.carousel&&slider.active.last){ if(slider.settings.mode=='horizontal'){ var lastChild=slider.children.eq(slider.children.length - 1); position=lastChild.position(); moveBy=slider.viewport.width() - lastChild.outerWidth(); }else{ var lastShowingIndex=slider.children.length - slider.settings.minSlides; position=slider.children.eq(lastShowingIndex).position(); }}else if(slider.carousel&&slider.active.last&&direction=='prev'){ var eq=slider.settings.moveSlides==1 ? slider.settings.maxSlides - getMoveBy():((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides); var lastChild=el.children('.bx-clone').eq(eq); position=lastChild.position(); }else if(direction=='next'&&slider.active.index==0){ position=el.find('> .bx-clone').eq(slider.settings.maxSlides).position(); slider.active.last=false; }else if(slideIndex >=0){ var requestEl=slideIndex * getMoveBy(); position=slider.children.eq(requestEl).position(); } if("undefined"!==typeof(position)){ var value=slider.settings.mode=='horizontal' ? -(position.left - moveBy):-position.top; setPositionProperty(value, 'slide', slider.settings.speed); }} } el.goToNextSlide=function(){ if(!slider.settings.infiniteLoop&&slider.active.last) return; var pagerIndex=parseInt(slider.active.index) + 1; el.goToSlide(pagerIndex, 'next'); } el.goToPrevSlide=function(){ if(!slider.settings.infiniteLoop&&slider.active.index==0) return; var pagerIndex=parseInt(slider.active.index) - 1; el.goToSlide(pagerIndex, 'prev'); } el.startAuto=function(preventControlUpdate){ if(slider.interval) return; slider.interval=setInterval(function(){ slider.settings.autoDirection=='next' ? el.goToNextSlide():el.goToPrevSlide(); }, slider.settings.pause); if(slider.settings.autoControls&&preventControlUpdate!=true) updateAutoControls('stop'); } el.stopAuto=function(preventControlUpdate){ if(!slider.interval) return; clearInterval(slider.interval); slider.interval=null; if(slider.settings.autoControls&&preventControlUpdate!=true) updateAutoControls('start'); } el.getCurrentSlide=function(){ return slider.active.index; } el.getCurrentSlideElement=function(){ return slider.children.eq(slider.active.index); } el.getSlideCount=function(){ return slider.children.length; } el.redrawSlider=function(){ slider.children.add(el.find('.bx-clone')).width(getSlideWidth()); slider.viewport.css('height', getViewportHeight()); if(!slider.settings.ticker) setSlidePosition(); if(slider.active.last) slider.active.index=getPagerQty() - 1; if(slider.active.index >=getPagerQty()) slider.active.last=true; if(slider.settings.pager&&!slider.settings.pagerCustom){ populatePager(); updatePagerActive(slider.active.index); }} el.destroySlider=function(){ if(!slider.initialized) return; slider.initialized=false; $('.bx-clone', this).remove(); slider.children.each(function(){ $(this).data("origStyle")!=undefined ? $(this).attr("style", $(this).data("origStyle")):$(this).removeAttr('style'); }); $(this).data("origStyle")!=undefined ? this.attr("style", $(this).data("origStyle")):$(this).removeAttr('style'); $(this).unwrap().unwrap(); if(slider.controls.el) slider.controls.el.remove(); if(slider.controls.next) slider.controls.next.remove(); if(slider.controls.prev) slider.controls.prev.remove(); if(slider.pagerEl&&slider.settings.controls) slider.pagerEl.remove(); $('.bx-caption', this).remove(); if(slider.controls.autoEl) slider.controls.autoEl.remove(); clearInterval(slider.interval); if(slider.settings.responsive) $(window).unbind('resize', resizeWindow); } el.reloadSlider=function(settings){ if(settings!=undefined) options=settings; el.destroySlider(); init(); } init(); return this; }})(jQuery); ;(function($, window, document, undefined){ var drag, state, e; drag={ start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, offsetX: 0, offsetY: 0, distance: null, startTime: 0, endTime: 0, updatedX: 0, targetEl: null }; state={ isTouch: false, isScrolling: false, isSwiping: false, direction: false, inMotion: false }; e={ _onDragStart: null, _onDragMove: null, _onDragEnd: null, _transitionEnd: null, _resizer: null, _responsiveCall: null, _goToLoop: null, _checkVisibile: null }; function Owl(element, options){ this.settings=null; this.options=$.extend({}, Owl.Defaults, options); this.$element=$(element); this.drag=$.extend({}, drag); this.state=$.extend({}, state); this.e=$.extend({}, e); this._plugins={}; this._supress={}; this._current=null; this._speed=null; this._coordinates=[]; this._breakpoint=null; this._width=null; this._items=[]; this._clones=[]; this._mergers=[]; this._invalidated={}; this._pipe=[]; $.each(Owl.Plugins, $.proxy(function(key, plugin){ this._plugins[key[0].toLowerCase() + key.slice(1)] = new plugin(this); }, this)); $.each(Owl.Pipe, $.proxy(function(priority, worker){ this._pipe.push({ 'filter': worker.filter, 'run': $.proxy(worker.run, this) }); }, this)); this.setup(); this.initialize(); } Owl.Defaults={ items: 3, loop: false, center: false, mouseDrag: true, touchDrag: true, pullDrag: true, freeDrag: false, margin: 0, stagePadding: 0, merge: false, mergeFit: true, autoWidth: false, startPosition: 0, rtl: false, smartSpeed: 250, fluidSpeed: false, dragEndSpeed: false, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: window, responsiveClass: false, fallbackEasing: 'swing', info: false, nestedItemSelector: false, itemElement: 'div', stageElement: 'div', themeClass: 'owl-theme', baseClass: 'owl-carousel', itemClass: 'owl-item', centerClass: 'center', activeClass: 'active' }; Owl.Width={ Default: 'default', Inner: 'inner', Outer: 'outer' }; Owl.Plugins={}; Owl.Pipe=[ { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=this._items&&this._items[this.relative(this._current)]; }}, { filter: [ 'items', 'settings' ], run: function(){ var cached=this._clones, clones=this.$stage.children('.cloned'); if(clones.length!==cached.length||(!this.settings.loop&&cached.length > 0)){ this.$stage.children('.cloned').remove(); this._clones=[]; }} }, { filter: [ 'items', 'settings' ], run: function(){ var i, n, clones=this._clones, items=this._items, delta=this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4):0; for (i=0, n=Math.abs(delta / 2); i < n; i++){ if(delta > 0){ this.$stage.children().eq(items.length + clones.length - 1).remove(); clones.pop(); this.$stage.children().eq(0).remove(); clones.pop(); }else{ clones.push(clones.length / 2); this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned')); clones.push(items.length - 1 - (clones.length - 1) / 2); this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned')); }} }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var rtl=(this.settings.rtl ? 1:-1), width=(this.width() / this.settings.items).toFixed(3), coordinate=0, merge, i, n; this._coordinates=[]; for (i=0, n=this._clones.length + this._items.length; i < n; i++){ merge=this._mergers[this.relative(i)]; merge=(this.settings.mergeFit&&Math.min(merge, this.settings.items))||merge; coordinate +=(this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin:width * merge) * rtl; this._coordinates.push(coordinate); }} }, { filter: [ 'width', 'items', 'settings' ], run: function(){ var i, n, width=(this.width() / this.settings.items).toFixed(3), css={ 'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2, 'padding-left': this.settings.stagePadding||'', 'padding-right': this.settings.stagePadding||'' }; this.$stage.css(css); css={ 'width': this.settings.autoWidth ? 'auto':width - this.settings.margin }; css[this.settings.rtl ? 'margin-left':'margin-right']=this.settings.margin; if(!this.settings.autoWidth&&$.grep(this._mergers, function(v){ return v > 1 }).length > 0){ for (i=0, n=this._coordinates.length; i < n; i++){ css.width=Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1]||0) - this.settings.margin; this.$stage.children().eq(i).css(css); }}else{ this.$stage.children().css(css); }} }, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current&&this.reset(this.$stage.children().index(cache.current)); }}, { filter: [ 'position' ], run: function(){ this.animate(this.coordinates(this._current)); }}, { filter: [ 'width', 'position', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, padding=this.settings.stagePadding * 2, begin=this.coordinates(this.current()) + padding, end=begin + this.width() * rtl, inner, outer, matches=[], i, n; for (i=0, n=this._coordinates.length; i < n; i++){ inner=this._coordinates[i - 1]||0; outer=Math.abs(this._coordinates[i]) + padding * rtl; if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end))) || (this.op(outer, '<', begin)&&this.op(outer, '>', end))){ matches.push(i); }} this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass); if(this.settings.center){ this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass); this.$stage.children().eq(this.current()).addClass(this.settings.centerClass); }} } ]; Owl.prototype.initialize=function(){ this.trigger('initialize'); this.$element .addClass(this.settings.baseClass) .addClass(this.settings.themeClass) .toggleClass('owl-rtl', this.settings.rtl); this.browserSupport(); if(this.settings.autoWidth&&this.state.imagesLoaded!==true){ var imgs, nestedSelector, width; imgs=this.$element.find('img'); nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined; width=this.$element.children(nestedSelector).width(); if(imgs.length&&width <=0){ this.preloadAutoWidthImages(imgs); return false; }} this.$element.addClass('owl-loading'); this.$stage=$('<' + this.settings.stageElement + ' class="owl-stage"/>') .wrap('
'); this.$element.append(this.$stage.parent()); this.replace(this.$element.children().not(this.$stage.parent())); this._width=this.$element.width(); this.refresh(); this.$element.removeClass('owl-loading').addClass('owl-loaded'); this.eventsCall(); this.internalEvents(); this.addTriggerableEvents(); this.trigger('initialized'); }; Owl.prototype.setup=function(){ var viewport=this.viewport(), overwrites=this.options.responsive, match=-1, settings=null; if(!overwrites){ settings=$.extend({}, this.options); }else{ $.each(overwrites, function(breakpoint){ if(breakpoint <=viewport&&breakpoint > match){ match=Number(breakpoint); }}); settings=$.extend({}, this.options, overwrites[match]); delete settings.responsive; if(settings.responsiveClass){ this.$element.attr('class', function(i, c){ return c.replace(/\b owl-responsive-\S+/g, ''); }).addClass('owl-responsive-' + match); }} if(this.settings===null||this._breakpoint!==match){ this.trigger('change', { property: { name: 'settings', value: settings }}); this._breakpoint=match; this.settings=settings; this.invalidate('settings'); this.trigger('changed', { property: { name: 'settings', value: this.settings }}); }}; Owl.prototype.optionsLogic=function(){ this.$element.toggleClass('owl-center', this.settings.center); if(this.settings.loop&&this._items.length < this.settings.items){ this.settings.loop=false; } if(this.settings.autoWidth){ this.settings.stagePadding=false; this.settings.merge=false; }}; Owl.prototype.prepare=function(item){ var event=this.trigger('prepare', { content: item }); if(!event.data){ event.data=$('<' + this.settings.itemElement + '/>') .addClass(this.settings.itemClass).append(item) } this.trigger('prepared', { content: event.data }); return event.data; }; Owl.prototype.update=function(){ var i=0, n=this._pipe.length, filter=$.proxy(function(p){ return this[p] }, this._invalidated), cache={}; while (i < n){ if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){ this._pipe[i].run(cache); } i++; } this._invalidated={};}; Owl.prototype.width=function(dimension){ dimension=dimension||Owl.Width.Default; switch (dimension){ case Owl.Width.Inner: case Owl.Width.Outer: return this._width; default: return this._width - this.settings.stagePadding * 2 + this.settings.margin; }}; Owl.prototype.refresh=function(){ if(this._items.length===0){ return false; } var start=new Date().getTime(); this.trigger('refresh'); this.setup(); this.optionsLogic(); this.$stage.addClass('owl-refresh'); this.update(); this.$stage.removeClass('owl-refresh'); this.state.orientation=window.orientation; this.watchVisibility(); this.trigger('refreshed'); }; Owl.prototype.eventsCall=function(){ this.e._onDragStart=$.proxy(function(e){ this.onDragStart(e); }, this); this.e._onDragMove=$.proxy(function(e){ this.onDragMove(e); }, this); this.e._onDragEnd=$.proxy(function(e){ this.onDragEnd(e); }, this); this.e._onResize=$.proxy(function(e){ this.onResize(e); }, this); this.e._transitionEnd=$.proxy(function(e){ this.transitionEnd(e); }, this); this.e._preventClick=$.proxy(function(e){ this.preventClick(e); }, this); }; Owl.prototype.onThrottledResize=function(){ window.clearTimeout(this.resizeTimer); this.resizeTimer=window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate); }; Owl.prototype.onResize=function(){ if(!this._items.length){ return false; } if(this._width===this.$element.width()){ return false; } if(this.trigger('resize').isDefaultPrevented()){ return false; } this._width=this.$element.width(); this.invalidate('width'); this.refresh(); this.trigger('resized'); }; Owl.prototype.eventsRouter=function(event){ var type=event.type; if(type==="mousedown"||type==="touchstart"){ this.onDragStart(event); }else if(type==="mousemove"||type==="touchmove"){ this.onDragMove(event); }else if(type==="mouseup"||type==="touchend"){ this.onDragEnd(event); }else if(type==="touchcancel"){ this.onDragEnd(event); }}; Owl.prototype.internalEvents=function(){ var isTouch=isTouchSupport(), isTouchIE=isTouchSupportIE(); if(this.settings.mouseDrag){ this.$stage.on('mousedown', $.proxy(function(event){ this.eventsRouter(event) }, this)); this.$stage.on('dragstart', function(){ return false }); this.$stage.get(0).onselectstart=function(){ return false };}else{ this.$element.addClass('owl-text-select-on'); } if(this.settings.touchDrag&&!isTouchIE){ this.$stage.on('touchstart touchcancel', $.proxy(function(event){ this.eventsRouter(event) }, this)); } if(this.transitionEndVendor){ this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false); } if(this.settings.responsive!==false){ this.on(window, 'resize', $.proxy(this.onThrottledResize, this)); }}; Owl.prototype.onDragStart=function(event){ var ev, isTouchEvent, pageX, pageY, animatedPos; ev=event.originalEvent||event||window.event; if(ev.which===3||this.state.isTouch){ return false; } if(ev.type==='mousedown'){ this.$stage.addClass('owl-grab'); } this.trigger('drag'); this.drag.startTime=new Date().getTime(); this.speed(0); this.state.isTouch=true; this.state.isScrolling=false; this.state.isSwiping=false; this.drag.distance=0; pageX=getTouches(ev).x; pageY=getTouches(ev).y; this.drag.offsetX=this.$stage.position().left; this.drag.offsetY=this.$stage.position().top; if(this.settings.rtl){ this.drag.offsetX=this.$stage.position().left + this.$stage.width() - this.width() + this.settings.margin; } if(this.state.inMotion&&this.support3d){ animatedPos=this.getTransformProperty(); this.drag.offsetX=animatedPos; this.animate(animatedPos); this.state.inMotion=true; }else if(this.state.inMotion&&!this.support3d){ this.state.inMotion=false; return false; } this.drag.startX=pageX - this.drag.offsetX; this.drag.startY=pageY - this.drag.offsetY; this.drag.start=pageX - this.drag.startX; this.drag.targetEl=ev.target||ev.srcElement; this.drag.updatedX=this.drag.start; if(this.drag.targetEl.tagName==="IMG"||this.drag.targetEl.tagName==="A"){ this.drag.targetEl.draggable=false; } $(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event){this.eventsRouter(event)},this)); }; Owl.prototype.onDragMove=function(event){ var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull; if(!this.state.isTouch){ return; } if(this.state.isScrolling){ return; } ev=event.originalEvent||event||window.event; pageX=getTouches(ev).x; pageY=getTouches(ev).y; this.drag.currentX=pageX - this.drag.startX; this.drag.currentY=pageY - this.drag.startY; this.drag.distance=this.drag.currentX - this.drag.offsetX; if(this.drag.distance < 0){ this.state.direction=this.settings.rtl ? 'right':'left'; }else if(this.drag.distance > 0){ this.state.direction=this.settings.rtl ? 'left':'right'; } if(this.settings.loop){ if(this.op(this.drag.currentX, '>', this.coordinates(this.minimum()))&&this.state.direction==='right'){ this.drag.currentX -=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length); }else if(this.op(this.drag.currentX, '<', this.coordinates(this.maximum()))&&this.state.direction==='left'){ this.drag.currentX +=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length); }}else{ minValue=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum()); maxValue=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum()); pull=this.settings.pullDrag ? this.drag.distance / 5:0; this.drag.currentX=Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull); } if((this.drag.distance > 8||this.drag.distance < -8)){ if(ev.preventDefault!==undefined){ ev.preventDefault(); }else{ ev.returnValue=false; } this.state.isSwiping=true; } this.drag.updatedX=this.drag.currentX; if((this.drag.currentY > 16||this.drag.currentY < -16)&&this.state.isSwiping===false){ this.state.isScrolling=true; this.drag.updatedX=this.drag.start; } this.animate(this.drag.updatedX); }; Owl.prototype.onDragEnd=function(event){ var compareTimes, distanceAbs, closest; if(!this.state.isTouch){ return; } if(event.type==='mouseup'){ this.$stage.removeClass('owl-grab'); } this.trigger('dragged'); this.drag.targetEl.removeAttribute("draggable"); this.state.isTouch=false; this.state.isScrolling=false; this.state.isSwiping=false; if(this.drag.distance===0&&this.state.inMotion!==true){ this.state.inMotion=false; return false; } this.drag.endTime=new Date().getTime(); compareTimes=this.drag.endTime - this.drag.startTime; distanceAbs=Math.abs(this.drag.distance); if(distanceAbs > 3||compareTimes > 300){ this.removeClick(this.drag.targetEl); } closest=this.closest(this.drag.updatedX); this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed); this.current(closest); this.invalidate('position'); this.update(); if(!this.settings.pullDrag&&this.drag.updatedX===this.coordinates(closest)){ this.transitionEnd(); } this.drag.distance=0; $(document).off('.owl.dragEvents'); }; Owl.prototype.removeClick=function(target){ this.drag.targetEl=target; $(target).on('click.preventClick', this.e._preventClick); window.setTimeout(function(){ $(target).off('click.preventClick'); }, 300); }; Owl.prototype.preventClick=function(ev){ if(ev.preventDefault){ ev.preventDefault(); }else{ ev.returnValue=false; } if(ev.stopPropagation){ ev.stopPropagation(); } $(ev.target).off('click.preventClick'); }; Owl.prototype.getTransformProperty=function(){ var transform, matrix3d; transform=window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform'); transform=transform.replace(/matrix(3d)?\(|\)/g, '').split(','); matrix3d=transform.length===16; return matrix3d!==true ? transform[4]:transform[12]; }; Owl.prototype.closest=function(coordinate){ var position=-1, pull=30, width=this.width(), coordinates=this.coordinates(); if(!this.settings.freeDrag){ $.each(coordinates, $.proxy(function(index, value){ if(coordinate > value - pull&&coordinate < value + pull){ position=index; }else if(this.op(coordinate, '<', value) && this.op(coordinate, '>', coordinates[index + 1]||value - width)){ position=this.state.direction==='left' ? index + 1:index; } return position===-1; }, this)); } if(!this.settings.loop){ if(this.op(coordinate, '>', coordinates[this.minimum()])){ position=coordinate=this.minimum(); }else if(this.op(coordinate, '<', coordinates[this.maximum()])){ position=coordinate=this.maximum(); }} return position; }; Owl.prototype.animate=function(coordinate){ this.trigger('translate'); this.state.inMotion=this.speed() > 0; if(this.support3d){ this.$stage.css({ transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)', transition: (this.speed() / 1000) + 's' }); }else if(this.state.isTouch){ this.$stage.css({ left: coordinate + 'px' }); }else{ this.$stage.animate({ left: coordinate }, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function(){ if(this.state.inMotion){ this.transitionEnd(); }}, this)); }}; Owl.prototype.current=function(position){ if(position===undefined){ return this._current; } if(this._items.length===0){ return undefined; } position=this.normalize(position); if(this._current!==position){ var event=this.trigger('change', { property: { name: 'position', value: position }}); if(event.data!==undefined){ position=this.normalize(event.data); } this._current=position; this.invalidate('position'); this.trigger('changed', { property: { name: 'position', value: this._current }}); } return this._current; }; Owl.prototype.invalidate=function(part){ this._invalidated[part]=true; } Owl.prototype.reset=function(position){ position=this.normalize(position); if(position===undefined){ return; } this._speed=0; this._current=position; this.suppress([ 'translate', 'translated' ]); this.animate(this.coordinates(position)); this.release([ 'translate', 'translated' ]); }; Owl.prototype.normalize=function(position, relative){ var n=(relative ? this._items.length:this._items.length + this._clones.length); if(!$.isNumeric(position)||n < 1){ return undefined; } if(this._clones.length){ position=((position % n) + n) % n; }else{ position=Math.max(this.minimum(relative), Math.min(this.maximum(relative), position)); } return position; }; Owl.prototype.relative=function(position){ position=this.normalize(position); position=position - this._clones.length / 2; return this.normalize(position, true); }; Owl.prototype.maximum=function(relative){ var maximum, width, i=0, coordinate, settings=this.settings; if(relative){ return this._items.length - 1; } if(!settings.loop&&settings.center){ maximum=this._items.length - 1; }else if(!settings.loop&&!settings.center){ maximum=this._items.length - settings.items; }else if(settings.loop||settings.center){ maximum=this._items.length + settings.items; }else if(settings.autoWidth||settings.merge){ revert=settings.rtl ? 1:-1; width=this.$stage.width() - this.$element.width(); while (coordinate=this.coordinates(i)){ if(coordinate * revert >=width){ break; } maximum=++i; }}else{ throw 'Can not detect maximum absolute position.' } return maximum; }; Owl.prototype.minimum=function(relative){ if(relative){ return 0; } return this._clones.length / 2; }; Owl.prototype.items=function(position){ if(position===undefined){ return this._items.slice(); } position=this.normalize(position, true); return this._items[position]; }; Owl.prototype.mergers=function(position){ if(position===undefined){ return this._mergers.slice(); } position=this.normalize(position, true); return this._mergers[position]; }; Owl.prototype.clones=function(position){ var odd=this._clones.length / 2, even=odd + this._items.length, map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 }; if(position===undefined){ return $.map(this._clones, function(v, i){ return map(i) }); } return $.map(this._clones, function(v, i){ return v===position ? map(i):null }); }; Owl.prototype.speed=function(speed){ if(speed!==undefined){ this._speed=speed; } return this._speed; }; Owl.prototype.coordinates=function(position){ var coordinate=null; if(position===undefined){ return $.map(this._coordinates, $.proxy(function(coordinate, index){ return this.coordinates(index); }, this)); } if(this.settings.center){ coordinate=this._coordinates[position]; coordinate +=(this.width() - coordinate + (this._coordinates[position - 1]||0)) / 2 * (this.settings.rtl ? -1:1); }else{ coordinate=this._coordinates[position - 1]||0; } return coordinate; }; Owl.prototype.duration=function(from, to, factor){ return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed)); }; Owl.prototype.to=function(position, speed){ if(this.settings.loop){ var distance=position - this.relative(this.current()), revert=this.current(), before=this.current(), after=this.current() + distance, direction=before - after < 0 ? true:false, items=this._clones.length + this._items.length; if(after < this.settings.items&&direction===false){ revert=before + this._items.length; this.reset(revert); }else if(after >=items - this.settings.items&&direction===true){ revert=before - this._items.length; this.reset(revert); } window.clearTimeout(this.e._goToLoop); this.e._goToLoop=window.setTimeout($.proxy(function(){ this.speed(this.duration(this.current(), revert + distance, speed)); this.current(revert + distance); this.update(); }, this), 30); }else{ this.speed(this.duration(this.current(), position, speed)); this.current(position); this.update(); }}; Owl.prototype.next=function(speed){ speed=speed||false; this.to(this.relative(this.current()) + 1, speed); }; Owl.prototype.prev=function(speed){ speed=speed||false; this.to(this.relative(this.current()) - 1, speed); }; Owl.prototype.transitionEnd=function(event){ if(event!==undefined){ event.stopPropagation(); if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){ return false; }} this.state.inMotion=false; this.trigger('translated'); }; Owl.prototype.viewport=function(){ var width; if(this.options.responsiveBaseElement!==window){ width=$(this.options.responsiveBaseElement).width(); }else if(window.innerWidth){ width=window.innerWidth; }else if(document.documentElement&&document.documentElement.clientWidth){ width=document.documentElement.clientWidth; }else{ throw 'Can not detect viewport width.'; } return width; }; Owl.prototype.replace=function(content){ this.$stage.empty(); this._items=[]; if(content){ content=(content instanceof jQuery) ? content:$(content); } if(this.settings.nestedItemSelector){ content=content.find('.' + this.settings.nestedItemSelector); } content.filter(function(){ return this.nodeType===1; }).each($.proxy(function(index, item){ item=this.prepare(item); this.$stage.append(item); this._items.push(item); this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); }, this)); this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0); this.invalidate('items'); }; Owl.prototype.add=function(content, position){ position=position===undefined ? this._items.length:this.normalize(position, true); this.trigger('add', { content: content, position: position }); if(this._items.length===0||position===this._items.length){ this.$stage.append(content); this._items.push(content); this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); }else{ this._items[position].before(content); this._items.splice(position, 0, content); this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); } this.invalidate('items'); this.trigger('added', { content: content, position: position }); }; Owl.prototype.remove=function(position){ position=this.normalize(position, true); if(position===undefined){ return; } this.trigger('remove', { content: this._items[position], position: position }); this._items[position].remove(); this._items.splice(position, 1); this._mergers.splice(position, 1); this.invalidate('items'); this.trigger('removed', { content: null, position: position }); }; Owl.prototype.addTriggerableEvents=function(){ var handler=$.proxy(function(callback, event){ return $.proxy(function(e){ if(e.relatedTarget!==this){ this.suppress([ event ]); callback.apply(this, [].slice.call(arguments, 1)); this.release([ event ]); }}, this); }, this); $.each({ 'next': this.next, 'prev': this.prev, 'to': this.to, 'destroy': this.destroy, 'refresh': this.refresh, 'replace': this.replace, 'add': this.add, 'remove': this.remove }, $.proxy(function(event, callback){ this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel')); }, this)); }; Owl.prototype.watchVisibility=function(){ if(!isElVisible(this.$element.get(0))){ this.$element.addClass('owl-hidden'); window.clearInterval(this.e._checkVisibile); this.e._checkVisibile=window.setInterval($.proxy(checkVisible, this), 500); } function isElVisible(el){ return el.offsetWidth > 0&&el.offsetHeight > 0; } function checkVisible(){ if(isElVisible(this.$element.get(0))){ this.$element.removeClass('owl-hidden'); this.refresh(); window.clearInterval(this.e._checkVisibile); }} }; Owl.prototype.preloadAutoWidthImages=function(imgs){ var loaded, that, $el, img; loaded=0; that=this; imgs.each(function(i, el){ $el=$(el); img=new Image(); img.onload=function(){ loaded++; $el.attr('src', img.src); $el.css('opacity', 1); if(loaded >=imgs.length){ that.state.imagesLoaded=true; that.initialize(); }}; img.src=$el.attr('src')||$el.attr('data-src')||$el.attr('data-src-retina'); }); }; Owl.prototype.destroy=function(){ if(this.$element.hasClass(this.settings.themeClass)){ this.$element.removeClass(this.settings.themeClass); } if(this.settings.responsive!==false){ $(window).off('resize.owl.carousel'); } if(this.transitionEndVendor){ this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd); } for(var i in this._plugins){ this._plugins[i].destroy(); } if(this.settings.mouseDrag||this.settings.touchDrag){ this.$stage.off('mousedown touchstart touchcancel'); $(document).off('.owl.dragEvents'); this.$stage.get(0).onselectstart=function(){}; this.$stage.off('dragstart', function(){ return false }); } this.$element.off('.owl'); this.$stage.children('.cloned').remove(); this.e=null; this.$element.removeData('owlCarousel'); this.$stage.children().contents().unwrap(); this.$stage.children().unwrap(); this.$stage.unwrap(); }; Owl.prototype.op=function(a, o, b){ var rtl=this.settings.rtl; switch (o){ case '<': return rtl ? a > b:a < b; case '>': return rtl ? a < b:a > b; case '>=': return rtl ? a <=b:a >=b; case '<=': return rtl ? a >=b:a <=b; default: break; }}; Owl.prototype.on=function(element, event, listener, capture){ if(element.addEventListener){ element.addEventListener(event, listener, capture); }else if(element.attachEvent){ element.attachEvent('on' + event, listener); }}; Owl.prototype.off=function(element, event, listener, capture){ if(element.removeEventListener){ element.removeEventListener(event, listener, capture); }else if(element.detachEvent){ element.detachEvent('on' + event, listener); }}; Owl.prototype.trigger=function(name, data, namespace){ var status={ item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v }) .join('-').toLowerCase() ), event=$.Event([ name, 'owl', namespace||'carousel' ].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data) ); if(!this._supress[name]){ $.each(this._plugins, function(name, plugin){ if(plugin.onTrigger){ plugin.onTrigger(event); }}); this.$element.trigger(event); if(this.settings&&typeof this.settings[handler]==='function'){ this.settings[handler].apply(this, event); }} return event; }; Owl.prototype.suppress=function(events){ $.each(events, $.proxy(function(index, event){ this._supress[event]=true; }, this)); } Owl.prototype.release=function(events){ $.each(events, $.proxy(function(index, event){ delete this._supress[event]; }, this)); } Owl.prototype.browserSupport=function(){ this.support3d=isPerspective(); if(this.support3d){ this.transformVendor=isTransform(); var endVendors=[ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ]; this.transitionEndVendor=endVendors[isTransition()]; this.vendorName=this.transformVendor.replace(/Transform/i, ''); this.vendorName=this.vendorName!=='' ? '-' + this.vendorName.toLowerCase() + '-':''; } this.state.orientation=window.orientation; }; function getTouches(event){ if(event.touches!==undefined){ return { x: event.touches[0].pageX, y: event.touches[0].pageY };} if(event.touches===undefined){ if(event.pageX!==undefined){ return { x: event.pageX, y: event.pageY };} if(event.pageX===undefined){ return { x: event.clientX, y: event.clientY };}} } function isStyleSupported(array){ var p, s, fake=document.createElement('div'), list=array; for (p in list){ s=list[p]; if(typeof fake.style[s]!=='undefined'){ fake=null; return [ s, p ]; }} return [ false ]; } function isTransition(){ return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1]; } function isTransform(){ return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0]; } function isPerspective(){ return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0]; } function isTouchSupport(){ return 'ontouchstart' in window||!!(navigator.msMaxTouchPoints); } function isTouchSupportIE(){ return window.navigator.msPointerEnabled; } $.fn.owlCarousel=function(options){ return this.each(function(){ if(!$(this).data('owlCarousel')){ $(this).data('owlCarousel', new Owl(this, options)); }}); }; $.fn.owlCarousel.Constructor=Owl; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Lazy=function(carousel){ this._core=carousel; this._loaded=[]; this._handlers={ 'initialized.owl.carousel change.owl.carousel': $.proxy(function(e){ if(!e.namespace){ return; } if(!this._core.settings||!this._core.settings.lazyLoad){ return; } if((e.property&&e.property.name=='position')||e.type=='initialized'){ var settings=this._core.settings, n=(settings.center&&Math.ceil(settings.items / 2)||settings.items), i=((settings.center&&n * -1)||0), position=((e.property&&e.property.value)||this._core.current()) + i, clones=this._core.clones().length, load=$.proxy(function(i, v){ this.load(v) }, this); while (i++ < n){ this.load(clones / 2 + this._core.relative(position)); clones&&$.each(this._core.clones(this._core.relative(position++)), load); }} }, this) }; this._core.options=$.extend({}, Lazy.Defaults, this._core.options); this._core.$element.on(this._handlers); } Lazy.Defaults={ lazyLoad: false } Lazy.prototype.load=function(position){ var $item=this._core.$stage.children().eq(position), $elements=$item&&$item.find('.owl-lazy'); if(!$elements||$.inArray($item.get(0), this._loaded) > -1){ return; } $elements.each($.proxy(function(index, element){ var $element=$(element), image, url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src'); this._core.trigger('load', { element: $element, url: url }, 'lazy'); if($element.is('img')){ $element.one('load.owl.lazy', $.proxy(function(){ $element.css('opacity', 1); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this)).attr('src', url); }else{ image=new Image(); image.onload=$.proxy(function(){ $element.css({ 'background-image': 'url(' + url + ')', 'opacity': '1' }); this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); }, this); image.src=url; }}, this)); this._loaded.push($item.get(0)); } Lazy.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this._core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }} $.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var AutoHeight=function(carousel){ this._core=carousel; this._handlers={ 'initialized.owl.carousel': $.proxy(function(){ if(this._core.settings.autoHeight){ this.update(); }}, this), 'changed.owl.carousel': $.proxy(function(e){ if(this._core.settings.autoHeight&&e.property.name=='position'){ this.update(); }}, this), 'loaded.owl.lazy': $.proxy(function(e){ if(this._core.settings.autoHeight&&e.element.closest('.' + this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())){ this.update(); }}, this) }; this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options); this._core.$element.on(this._handlers); }; AutoHeight.Defaults={ autoHeight: false, autoHeightClass: 'owl-height' }; AutoHeight.prototype.update=function(){ this._core.$stage.parent() .height(this._core.$stage.children().eq(this._core.current()).height()) .addClass(this._core.settings.autoHeightClass); }; AutoHeight.prototype.destroy=function(){ var handler, property; for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Video=function(carousel){ this._core=carousel; this._videos={}; this._playing=null; this._fullscreen=false; this._handlers={ 'resize.owl.carousel': $.proxy(function(e){ if(this._core.settings.video&&!this.isInFullScreen()){ e.preventDefault(); }}, this), 'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e){ if(this._playing){ this.stop(); }}, this), 'prepared.owl.carousel': $.proxy(function(e){ var $element=$(e.content).find('.owl-video'); if($element.length){ $element.css('display', 'none'); this.fetch($element, $(e.content)); }}, this) }; this._core.options=$.extend({}, Video.Defaults, this._core.options); this._core.$element.on(this._handlers); this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){ this.play(e); }, this)); }; Video.Defaults={ video: false, videoHeight: false, videoWidth: false }; Video.prototype.fetch=function(target, item){ var type=target.attr('data-vimeo-id') ? 'vimeo':'youtube', id=target.attr('data-vimeo-id')||target.attr('data-youtube-id'), width=target.attr('data-width')||this._core.settings.videoWidth, height=target.attr('data-height')||this._core.settings.videoHeight, url=target.attr('href'); if(url){ id=url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); if(id[3].indexOf('youtu') > -1){ type='youtube'; }else if(id[3].indexOf('vimeo') > -1){ type='vimeo'; }else{ throw new Error('Video URL not supported.'); } id=id[6]; }else{ throw new Error('Missing video URL.'); } this._videos[url]={ type: type, id: id, width: width, height: height }; item.attr('data-video', url); this.thumbnail(target, this._videos[url]); }; Video.prototype.thumbnail=function(target, video){ var tnLink, icon, path, dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'', customTn=target.find('img'), srcType='src', lazyClass='', settings=this._core.settings, create=function(path){ icon='
'; if(settings.lazyLoad){ tnLink='
'; }else{ tnLink='
'; } target.after(tnLink); target.after(icon); }; target.wrap('
'); if(this._core.settings.lazyLoad){ srcType='data-src'; lazyClass='owl-lazy'; } if(customTn.length){ create(customTn.attr(srcType)); customTn.remove(); return false; } if(video.type==='youtube'){ path="http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; create(path); }else if(video.type==='vimeo'){ $.ajax({ type: 'GET', url: 'http://vimeo.com/api/v2/video/' + video.id + '.json', jsonp: 'callback', dataType: 'jsonp', success: function(data){ path=data[0].thumbnail_large; create(path); }}); }}; Video.prototype.stop=function(){ this._core.trigger('stop', null, 'video'); this._playing.find('.owl-video-frame').remove(); this._playing.removeClass('owl-video-playing'); this._playing=null; }; Video.prototype.play=function(ev){ this._core.trigger('play', null, 'video'); if(this._playing){ this.stop(); } var target=$(ev.target||ev.srcElement), item=target.closest('.' + this._core.settings.itemClass), video=this._videos[item.attr('data-video')], width=video.width||'100%', height=video.height||this._core.$stage.height(), html, wrap; if(video.type==='youtube'){ html=''; }else if(video.type==='vimeo'){ html=''; } item.addClass('owl-video-playing'); this._playing=item; wrap=$('
' + html + '
'); target.after(wrap); }; Video.prototype.isInFullScreen=function(){ var element=document.fullscreenElement||document.mozFullScreenElement || document.webkitFullscreenElement; if(element&&$(element).parent().hasClass('owl-video-frame')){ this._core.speed(0); this._fullscreen=true; } if(element&&this._fullscreen&&this._playing){ return false; } if(this._fullscreen){ this._fullscreen=false; return false; } if(this._playing){ if(this._core.state.orientation!==window.orientation){ this._core.state.orientation=window.orientation; return false; }} return true; }; Video.prototype.destroy=function(){ var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Video=Video; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Animate=function(scope){ this.core=scope; this.core.options=$.extend({}, Animate.Defaults, this.core.options); this.swapping=true; this.previous=undefined; this.next=undefined; this.handlers={ 'change.owl.carousel': $.proxy(function(e){ if(e.property.name=='position'){ this.previous=this.core.current(); this.next=e.property.value; }}, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e){ this.swapping=e.type=='translated'; }, this), 'translate.owl.carousel': $.proxy(function(e){ if(this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){ this.swap(); }}, this) }; this.core.$element.on(this.handlers); }; Animate.Defaults={ animateOut: false, animateIn: false }; Animate.prototype.swap=function(){ if(this.core.settings.items!==1||!this.core.support3d){ return; } this.core.speed(0); var left, clear=$.proxy(this.clear, this), previous=this.core.$stage.children().eq(this.previous), next=this.core.$stage.children().eq(this.next), incoming=this.core.settings.animateIn, outgoing=this.core.settings.animateOut; if(this.core.current()===this.previous){ return; } if(outgoing){ left=this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.css({ 'left': left + 'px' }) .addClass('animated owl-animated-out') .addClass(outgoing) .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); } if(incoming){ next.addClass('animated owl-animated-in') .addClass(incoming) .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); }}; Animate.prototype.clear=function(e){ $(e.target).css({ 'left': '' }) .removeClass('animated owl-animated-out owl-animated-in') .removeClass(this.core.settings.animateIn) .removeClass(this.core.settings.animateOut); this.core.transitionEnd(); } Animate.prototype.destroy=function(){ var handler, property; for (handler in this.handlers){ this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.Animate=Animate; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ var Autoplay=function(scope){ this.core=scope; this.core.options=$.extend({}, Autoplay.Defaults, this.core.options); this.handlers={ 'translated.owl.carousel refreshed.owl.carousel': $.proxy(function(){ this.autoplay(); }, this), 'play.owl.autoplay': $.proxy(function(e, t, s){ this.play(t, s); }, this), 'stop.owl.autoplay': $.proxy(function(){ this.stop(); }, this), 'mouseover.owl.autoplay': $.proxy(function(){ if(this.core.settings.autoplayHoverPause){ this.pause(); }}, this), 'mouseleave.owl.autoplay': $.proxy(function(){ if(this.core.settings.autoplayHoverPause){ this.autoplay(); }}, this) }; this.core.$element.on(this.handlers); }; Autoplay.Defaults={ autoplay: false, autoplayTimeout: 5000, autoplayHoverPause: false, autoplaySpeed: false }; Autoplay.prototype.autoplay=function(){ if(this.core.settings.autoplay&&!this.core.state.videoPlay){ window.clearInterval(this.interval); this.interval=window.setInterval($.proxy(function(){ this.play(); }, this), this.core.settings.autoplayTimeout); }else{ window.clearInterval(this.interval); }}; Autoplay.prototype.play=function(timeout, speed){ if(document.hidden===true){ return; } if(this.core.state.isTouch||this.core.state.isScrolling || this.core.state.isSwiping||this.core.state.inMotion){ return; } if(this.core.settings.autoplay===false){ window.clearInterval(this.interval); return; } this.core.next(this.core.settings.autoplaySpeed); }; Autoplay.prototype.stop=function(){ window.clearInterval(this.interval); }; Autoplay.prototype.pause=function(){ window.clearInterval(this.interval); }; Autoplay.prototype.destroy=function(){ var handler, property; window.clearInterval(this.interval); for (handler in this.handlers){ this.core.$element.off(handler, this.handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }}; $.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Navigation=function(carousel){ this._core=carousel; this._initialized=false; this._pages=[]; this._controls={}; this._templates=[]; this.$element=this._core.$element; this._overrides={ next: this._core.next, prev: this._core.prev, to: this._core.to }; this._handlers={ 'prepared.owl.carousel': $.proxy(function(e){ if(this._core.settings.dotsData){ this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); }}, this), 'add.owl.carousel': $.proxy(function(e){ if(this._core.settings.dotsData){ this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); }}, this), 'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e){ if(this._core.settings.dotsData){ this._templates.splice(e.position, 1); }}, this), 'change.owl.carousel': $.proxy(function(e){ if(e.property.name=='position'){ if(!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){ var current=this._core.current(), maximum=this._core.maximum(), minimum=this._core.minimum(); e.data=e.property.value > maximum ? current >=maximum ? minimum:maximum : e.property.value < minimum ? maximum:e.property.value; }} }, this), 'changed.owl.carousel': $.proxy(function(e){ if(e.property.name=='position'){ this.draw(); }}, this), 'refreshed.owl.carousel': $.proxy(function(){ if(!this._initialized){ this.initialize(); this._initialized=true; } this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation'); }, this) }; this._core.options=$.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers); } Navigation.Defaults={ nav: false, navRewind: true, navText: [ 'prev', 'next' ], navSpeed: false, navElement: 'div', navContainer: false, navContainerClass: 'owl-nav', navClass: [ 'owl-prev', 'owl-next' ], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: true, dotsEach: false, dotData: false, dotsSpeed: false, dotsContainer: false, controlsClass: 'owl-controls' } Navigation.prototype.initialize=function(){ var $container, override, options=this._core.settings; if(!options.dotsData){ this._templates=[ $('
') .addClass(options.dotClass) .append($('')) .prop('outerHTML') ]; } if(!options.navContainer||!options.dotsContainer){ this._controls.$container=$('
') .addClass(options.controlsClass) .appendTo(this.$element); } this._controls.$indicators=options.dotsContainer ? $(options.dotsContainer) : $('
').hide().addClass(options.dotsClass).appendTo(this._controls.$container); this._controls.$indicators.on('click', 'div', $.proxy(function(e){ var index=$(e.target).parent().is(this._controls.$indicators) ? $(e.target).index():$(e.target).parent().index(); e.preventDefault(); this.to(index, options.dotsSpeed); }, this)); $container=options.navContainer ? $(options.navContainer) : $('
').addClass(options.navContainerClass).prependTo(this._controls.$container); this._controls.$next=$('<' + options.navElement + '>'); this._controls.$previous=this._controls.$next.clone(); this._controls.$previous .addClass(options.navClass[0]) .html(options.navText[0]) .hide() .prependTo($container) .on('click', $.proxy(function(e){ this.prev(options.navSpeed); }, this)); this._controls.$next .addClass(options.navClass[1]) .html(options.navText[1]) .hide() .appendTo($container) .on('click', $.proxy(function(e){ this.next(options.navSpeed); }, this)); for (override in this._overrides){ this._core[override]=$.proxy(this[override], this); }} Navigation.prototype.destroy=function(){ var handler, control, property, override; for (handler in this._handlers){ this.$element.off(handler, this._handlers[handler]); } for (control in this._controls){ this._controls[control].remove(); } for (override in this.overides){ this._core[override]=this._overrides[override]; } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }} Navigation.prototype.update=function(){ var i, j, k, options=this._core.settings, lower=this._core.clones().length / 2, upper=lower + this._core.items().length, size=options.center||options.autoWidth||options.dotData ? 1:options.dotsEach||options.items; if(options.slideBy!=='page'){ options.slideBy=Math.min(options.slideBy, options.items); } if(options.dots||options.slideBy=='page'){ this._pages=[]; for (i=lower, j=0, k=0; i < upper; i++){ if(j >=size||j===0){ this._pages.push({ start: i - lower, end: i - lower + size - 1 }); j=0, ++k; } j +=this._core.mergers(this._core.relative(i)); }} } Navigation.prototype.draw=function(){ var difference, i, html='', options=this._core.settings, $items=this._core.$stage.children(), index=this._core.relative(this._core.current()); if(options.nav&&!options.loop&&!options.navRewind){ this._controls.$previous.toggleClass('disabled', index <=0); this._controls.$next.toggleClass('disabled', index >=this._core.maximum()); } this._controls.$previous.toggle(options.nav); this._controls.$next.toggle(options.nav); if(options.dots){ difference=this._pages.length - this._controls.$indicators.children().length; if(options.dotData&&difference!==0){ for (i=0; i < this._controls.$indicators.children().length; i++){ html +=this._templates[this._core.relative(i)]; } this._controls.$indicators.html(html); }else if(difference > 0){ html=new Array(difference + 1).join(this._templates[0]); this._controls.$indicators.append(html); }else if(difference < 0){ this._controls.$indicators.children().slice(difference).remove(); } this._controls.$indicators.find('.active').removeClass('active'); this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active'); } this._controls.$indicators.toggle(options.dots); } Navigation.prototype.onTrigger=function(event){ var settings=this._core.settings; event.page={ index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings&&(settings.center||settings.autoWidth||settings.dotData ? 1:settings.dotsEach||settings.items) };} Navigation.prototype.current=function(){ var index=this._core.relative(this._core.current()); return $.grep(this._pages, function(o){ return o.start <=index&&o.end >=index; }).pop(); } Navigation.prototype.getPosition=function(successor){ var position, length, options=this._core.settings; if(options.slideBy=='page'){ position=$.inArray(this.current(), this._pages); length=this._pages.length; successor ? ++position:--position; position=this._pages[((position % length) + length) % length].start; }else{ position=this._core.relative(this._core.current()); length=this._core.items().length; successor ? position +=options.slideBy:position -=options.slideBy; } return position; } Navigation.prototype.next=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); } Navigation.prototype.prev=function(speed){ $.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); } Navigation.prototype.to=function(position, speed, standard){ var length; if(!standard){ length=this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed); }else{ $.proxy(this._overrides.to, this._core)(position, speed); }} $.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation; })(window.Zepto||window.jQuery, window, document); ;(function($, window, document, undefined){ 'use strict'; var Hash=function(carousel){ this._core=carousel; this._hashes={}; this.$element=this._core.$element; this._handlers={ 'initialized.owl.carousel': $.proxy(function(){ if(this._core.settings.startPosition=='URLHash'){ $(window).trigger('hashchange.owl.navigation'); }}, this), 'prepared.owl.carousel': $.proxy(function(e){ var hash=$(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash'); this._hashes[hash]=e.content; }, this) }; this._core.options=$.extend({}, Hash.Defaults, this._core.options); this.$element.on(this._handlers); $(window).on('hashchange.owl.navigation', $.proxy(function(){ var hash=window.location.hash.substring(1), items=this._core.$stage.children(), position=this._hashes[hash]&&items.index(this._hashes[hash])||0; if(!hash){ return false; } this._core.to(position, false, true); }, this)); } Hash.Defaults={ URLhashListener: false } Hash.prototype.destroy=function(){ var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers){ this._core.$element.off(handler, this._handlers[handler]); } for (property in Object.getOwnPropertyNames(this)){ typeof this[property]!='function'&&(this[property]=null); }} $.fn.owlCarousel.Constructor.Plugins.Hash=Hash; })(window.Zepto||window.jQuery, window, document); (function (window, document, $, undefined){ "use strict"; var H=$("html"), W=$(window), D=$(document), F=$.fancybox=function (){ F.open.apply(this, arguments); }, IE=navigator.userAgent.match(/msie/i), didUpdate=null, isTouch=document.createTouch!==undefined, isQuery=function(obj){ return obj&&obj.hasOwnProperty&&obj instanceof $; }, isString=function(str){ return str&&$.type(str)==="string"; }, isPercentage=function(str){ return isString(str)&&str.indexOf('%') > 0; }, isScrollable=function(el){ return (el&&!(el.style.overflow&&el.style.overflow==='hidden')&&((el.clientWidth&&el.scrollWidth > el.clientWidth)||(el.clientHeight&&el.scrollHeight > el.clientHeight))); }, getScalar=function(orig, dim){ var value=parseInt(orig, 10)||0; if(dim&&isPercentage(orig)){ value=F.getViewport()[ dim ] / 100 * value; } return Math.ceil(value); }, getValue=function(value, dim){ return getScalar(value, dim) + 'px'; }; $.extend(F, { version: '2.1.5', defaults: { padding:15, margin:20, width:800, height:600, minWidth:100, minHeight:100, maxWidth:9999, maxHeight:9999, pixelRatio: 1, autoSize:true, autoHeight:false, autoWidth:false, autoResize:true, autoCenter:!isTouch, fitToView:true, aspectRatio:false, topRatio:0.5, leftRatio:0.5, scrolling:'auto', // 'auto', 'yes' or 'no' wrapCSS:'', arrows:true, closeBtn:true, closeClick:false, nextClick:false, mouseWheel:true, autoPlay:false, playSpeed:3000, preload:3, modal:false, loop:true, ajax:{ dataType:'html', headers:{ 'X-fancyBox': true }}, iframe:{ scrolling:'auto', preload:true }, swf:{ wmode: 'transparent', allowfullscreen:'true', allowscriptaccess:'always' }, keys:{ next:{ 13:'left', 34:'up', 39:'left', 40:'up' }, prev:{ 8:'right', 33:'down', 37:'right', 38:'down' }, close:[27], play:[32], toggle:[70] }, direction:{ next:'left', prev:'right' }, scrollOutside:true, index:0, type:null, href:null, content:null, title:null, tpl: { wrap:'
', image:'', iframe:'', error:'

The requested content cannot be loaded.
Please try again later.

', closeBtn:'', next:'', prev:'' }, openEffect:'fade', // 'elastic', 'fade' or 'none' openSpeed:250, openEasing:'swing', openOpacity:true, openMethod:'zoomIn', closeEffect:'fade', // 'elastic', 'fade' or 'none' closeSpeed:250, closeEasing:'swing', closeOpacity:true, closeMethod:'zoomOut', nextEffect:'elastic', // 'elastic', 'fade' or 'none' nextSpeed:250, nextEasing:'swing', nextMethod:'changeIn', prevEffect:'elastic', // 'elastic', 'fade' or 'none' prevSpeed:250, prevEasing:'swing', prevMethod:'changeOut', helpers:{ overlay:true, title:true }, onCancel:$.noop, beforeLoad:$.noop, afterLoad:$.noop, beforeShow:$.noop, afterShow:$.noop, beforeChange:$.noop, beforeClose:$.noop, afterClose:$.noop }, group:{}, opts:{}, previous:null, coming:null, current:null, isActive:false, isOpen:false, isOpened:false, wrap:null, skin:null, outer:null, inner:null, player:{ timer:null, isActive:false }, ajaxLoad:null, imgPreload:null, transitions:{}, helpers:{}, open: function (group, opts){ if(!group){ return; } if(!$.isPlainObject(opts)){ opts={};} if(false===F.close(true)){ return; } if(!$.isArray(group)){ group=isQuery(group) ? $(group).get():[group]; } $.each(group, function(i, element){ var obj={}, href, title, content, type, rez, hrefParts, selector; if($.type(element)==="object"){ if(element.nodeType){ element=$(element); } if(isQuery(element)){ obj={ href:element.data('fancybox-href')||element.attr('href'), title:element.data('fancybox-title')||element.attr('title'), isDom:true, element:element }; if($.metadata){ $.extend(true, obj, element.metadata()); }}else{ obj=element; }} href=opts.href||obj.href||(isString(element) ? element:null); title=opts.title!==undefined ? opts.title:obj.title||''; content=opts.content||obj.content; type=content ? 'html':(opts.type||obj.type); if(!type&&obj.isDom){ type=element.data('fancybox-type'); if(!type){ rez=element.prop('class').match(/fancybox\.(\w+)/); type=rez ? rez[1]:null; }} if(isString(href)){ if(!type){ if(F.isImage(href)){ type='image'; }else if(F.isSWF(href)){ type='swf'; }else if(href.charAt(0)==='#'){ type='inline'; }else if(isString(element)){ type='html'; content=element; }} if(type==='ajax'){ hrefParts=href.split(/\s+/, 2); href=hrefParts.shift(); selector=hrefParts.shift(); }} if(!content){ if(type==='inline'){ if(href){ content=$(isString(href) ? href.replace(/.*(?=#[^\s]+$)/, ''):href); }else if(obj.isDom){ content=element; }}else if(type==='html'){ content=href; }else if(!type&&!href&&obj.isDom){ type='inline'; content=element; }} $.extend(obj, { href:href, type:type, content:content, title:title, selector:selector }); group[ i ]=obj; }); F.opts=$.extend(true, {}, F.defaults, opts); if(opts.keys!==undefined){ F.opts.keys=opts.keys ? $.extend({}, F.defaults.keys, opts.keys):false; } F.group=group; return F._start(F.opts.index); }, cancel: function (){ var coming=F.coming; if(!coming||false===F.trigger('onCancel')){ return; } F.hideLoading(); if(F.ajaxLoad){ F.ajaxLoad.abort(); } F.ajaxLoad=null; if(F.imgPreload){ F.imgPreload.onload=F.imgPreload.onerror=null; } if(coming.wrap){ coming.wrap.stop(true, true).trigger('onReset').remove(); } F.coming=null; if(!F.current){ F._afterZoomOut(coming); }}, close: function (event){ F.cancel(); if(false===F.trigger('beforeClose')){ return; } F.unbindEvents(); if(!F.isActive){ return; } if(!F.isOpen||event===true){ $('.fancybox-wrap').stop(true).trigger('onReset').remove(); F._afterZoomOut(); }else{ F.isOpen=F.isOpened=false; F.isClosing=true; $('.fancybox-item, .fancybox-nav').remove(); F.wrap.stop(true, true).removeClass('fancybox-opened'); F.transitions[ F.current.closeMethod ](); }}, play: function(action){ var clear=function (){ clearTimeout(F.player.timer); }, set=function (){ clear(); if(F.current&&F.player.isActive){ F.player.timer=setTimeout(F.next, F.current.playSpeed); }}, stop=function (){ clear(); D.unbind('.player'); F.player.isActive=false; F.trigger('onPlayEnd'); }, start=function (){ if(F.current&&(F.current.loop||F.current.index < F.group.length - 1)){ F.player.isActive=true; D.bind({ 'onCancel.player beforeClose.player':stop, 'onUpdate.player':set, 'beforeLoad.player':clear }); set(); F.trigger('onPlayStart'); }}; if(action===true||(!F.player.isActive&&action!==false)){ start(); }else{ stop(); }}, next: function(direction){ var current=F.current; if(current){ if(!isString(direction)){ direction=current.direction.next; } F.jumpto(current.index + 1, direction, 'next'); }}, prev: function(direction){ var current=F.current; if(current){ if(!isString(direction)){ direction=current.direction.prev; } F.jumpto(current.index - 1, direction, 'prev'); }}, jumpto: function(index, direction, router){ var current=F.current; if(!current){ return; } index=getScalar(index); F.direction=direction||current.direction[ (index >=current.index ? 'next':'prev') ]; F.router=router||'jumpto'; if(current.loop){ if(index < 0){ index=current.group.length + (index % current.group.length); } index=index % current.group.length; } if(current.group[ index ]!==undefined){ F.cancel(); F._start(index); }}, reposition: function (e, onlyAbsolute){ var current=F.current, wrap=current ? current.wrap:null, pos; if(wrap){ pos=F._getPosition(onlyAbsolute); if(e&&e.type==='scroll'){ delete pos.position; wrap.stop(true, true).animate(pos, 200); }else{ wrap.css(pos); current.pos=$.extend({}, current.dim, pos); }} }, update: function (e){ var type=(e&&e.type), anyway = !type||type==='orientationchange'; if(anyway){ clearTimeout(didUpdate); didUpdate=null; } if(!F.isOpen||didUpdate){ return; } didUpdate=setTimeout(function(){ var current=F.current; if(!current||F.isClosing){ return; } F.wrap.removeClass('fancybox-tmp'); if(anyway||type==='load'||(type==='resize'&¤t.autoResize)){ F._setDimension(); } if(!(type==='scroll'&¤t.canShrink)){ F.reposition(e); } F.trigger('onUpdate'); didUpdate=null; }, (anyway&&!isTouch ? 0:300)); }, toggle: function(action){ if(F.isOpen){ F.current.fitToView=$.type(action)==="boolean" ? action:!F.current.fitToView; if(isTouch){ F.wrap.removeAttr('style').addClass('fancybox-tmp'); F.trigger('onUpdate'); } F.update(); }}, hideLoading: function (){ D.unbind('.loading'); $('#fancybox-loading').remove(); }, showLoading: function (){ var el, viewport; F.hideLoading(); el=$('
').click(F.cancel).appendTo('body'); D.bind('keydown.loading', function(e){ if((e.which||e.keyCode)===27){ e.preventDefault(); F.cancel(); }}); if(!F.defaults.fixed){ viewport=F.getViewport(); el.css({ position:'absolute', top:(viewport.h * 0.5) + viewport.y, left:(viewport.w * 0.5) + viewport.x }); }}, getViewport: function (){ var locked=(F.current&&F.current.locked)||false, rez={ x: W.scrollLeft(), y: W.scrollTop() }; if(locked){ rez.w=locked[0].clientWidth; rez.h=locked[0].clientHeight; }else{ rez.w=isTouch&&window.innerWidth ? window.innerWidth:W.width(); rez.h=isTouch&&window.innerHeight ? window.innerHeight:W.height(); } return rez; }, unbindEvents: function (){ if(F.wrap&&isQuery(F.wrap)){ F.wrap.unbind('.fb'); } D.unbind('.fb'); W.unbind('.fb'); }, bindEvents: function (){ var current=F.current, keys; if(!current){ return; } W.bind('orientationchange.fb' + (isTouch ? '':' resize.fb') + (current.autoCenter&&!current.locked ? ' scroll.fb':''), F.update); keys=current.keys; if(keys){ D.bind('keydown.fb', function (e){ var code=e.which||e.keyCode, target=e.target||e.srcElement; if(code===27&&F.coming){ return false; } if(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey&&!(target&&(target.type||$(target).is('[contenteditable]')))){ $.each(keys, function(i, val){ if(current.group.length > 1&&val[ code ]!==undefined){ F[ i ](val[ code ]); e.preventDefault(); return false; } if($.inArray(code, val) > -1){ F[ i ] (); e.preventDefault(); return false; }}); }}); } if($.fn.mousewheel&¤t.mouseWheel){ F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY){ var target=e.target||null, parent=$(target), canScroll=false; while (parent.length){ if(canScroll||parent.is('.fancybox-skin')||parent.is('.fancybox-wrap')){ break; } canScroll=isScrollable(parent[0]); parent=$(parent).parent(); } if(delta!==0&&!canScroll){ if(F.group.length > 1&&!current.canShrink){ if(deltaY > 0||deltaX > 0){ F.prev(deltaY > 0 ? 'down':'left'); }else if(deltaY < 0||deltaX < 0){ F.next(deltaY < 0 ? 'up':'right'); } e.preventDefault(); }} }); }}, trigger: function (event, o){ var ret, obj=o||F.coming||F.current; if(!obj){ return; } if($.isFunction(obj[event])){ ret=obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); } if(ret===false){ return false; } if(obj.helpers){ $.each(obj.helpers, function (helper, opts){ if(opts&&F.helpers[helper]&&$.isFunction(F.helpers[helper][event])){ F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); }}); } D.trigger(event); }, isImage: function (str){ return isString(str)&&str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); }, isSWF: function (str){ return isString(str)&&str.match(/\.(swf)((\?|#).*)?$/i); }, _start: function (index){ var coming={}, obj, href, type, margin, padding; index=getScalar(index); obj=F.group[ index ]||null; if(!obj){ return false; } coming=$.extend(true, {}, F.opts, obj); margin=coming.margin; padding=coming.padding; if($.type(margin)==='number'){ coming.margin=[margin, margin, margin, margin]; } if($.type(padding)==='number'){ coming.padding=[padding, padding, padding, padding]; } if(coming.modal){ $.extend(true, coming, { closeBtn:false, closeClick:false, nextClick:false, arrows:false, mouseWheel:false, keys:null, helpers: { overlay:{ closeClick:false }} }); } if(coming.autoSize){ coming.autoWidth=coming.autoHeight=true; } if(coming.width==='auto'){ coming.autoWidth=true; } if(coming.height==='auto'){ coming.autoHeight=true; } /* * Add reference to the group, so it`s possible to access from callbacks, example: * afterLoad:function(){ * this.title='Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title:''); * } */ coming.group=F.group; coming.index=index; F.coming=coming; if(false===F.trigger('beforeLoad')){ F.coming=null; return; } type=coming.type; href=coming.href; if(!type){ F.coming=null; if(F.current&&F.router&&F.router!=='jumpto'){ F.current.index=index; return F[ F.router ](F.direction); } return false; } F.isActive=true; if(type==='image'||type==='swf'){ coming.autoHeight=coming.autoWidth=false; coming.scrolling='visible'; } if(type==='image'){ coming.aspectRatio=true; } if(type==='iframe'&&isTouch){ coming.scrolling='scroll'; } coming.wrap=$(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile':'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo(coming.parent||'body'); $.extend(coming, { skin:$('.fancybox-skin', coming.wrap), outer:$('.fancybox-outer', coming.wrap), inner:$('.fancybox-inner', coming.wrap) }); $.each(["Top", "Right", "Bottom", "Left"], function(i, v){ coming.skin.css('padding' + v, getValue(coming.padding[ i ])); }); F.trigger('onReady'); if(type==='inline'||type==='html'){ if(!coming.content||!coming.content.length){ return F._error('content'); }}else if(!href){ return F._error('href'); } if(type==='image'){ F._loadImage(); }else if(type==='ajax'){ F._loadAjax(); }else if(type==='iframe'){ F._loadIframe(); }else{ F._afterLoad(); }}, _error: function(type){ $.extend(F.coming, { type:'html', autoWidth:true, autoHeight:true, minWidth:0, minHeight:0, scrolling:'no', hasError:type, content:F.coming.tpl.error }); F._afterLoad(); }, _loadImage: function (){ var img=F.imgPreload=new Image(); img.onload=function (){ this.onload=this.onerror=null; F.coming.width=this.width / F.opts.pixelRatio; F.coming.height=this.height / F.opts.pixelRatio; F._afterLoad(); }; img.onerror=function (){ this.onload=this.onerror=null; F._error('image'); }; img.src=F.coming.href; if(img.complete!==true){ F.showLoading(); }}, _loadAjax: function (){ var coming=F.coming; F.showLoading(); F.ajaxLoad=$.ajax($.extend({}, coming.ajax, { url: coming.href, error: function (jqXHR, textStatus){ if(F.coming&&textStatus!=='abort'){ F._error('ajax', jqXHR); }else{ F.hideLoading(); }}, success: function (data, textStatus){ if(textStatus==='success'){ coming.content=data; F._afterLoad(); }} })); }, _loadIframe: function(){ var coming=F.coming, iframe=$(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) .attr('scrolling', isTouch ? 'auto':coming.iframe.scrolling) .attr('src', coming.href); $(coming.wrap).bind('onReset', function (){ try { $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); } catch (e){}}); if(coming.iframe.preload){ F.showLoading(); iframe.one('load', function(){ $(this).data('ready', 1); if(!isTouch){ $(this).bind('load.fb', F.update); } $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); F._afterLoad(); }); } coming.content=iframe.appendTo(coming.inner); if(!coming.iframe.preload){ F._afterLoad(); }}, _preloadImages: function(){ var group=F.group, current=F.current, len=group.length, cnt=current.preload ? Math.min(current.preload, len - 1):0, item, i; for (i=1; i <=cnt; i +=1){ item=group[ (current.index + i) % len ]; if(item.type==='image'&&item.href){ new Image().src=item.href; }} }, _afterLoad: function (){ var coming=F.coming, previous=F.current, placeholder='fancybox-placeholder', current, content, type, scrolling, href, embed; F.hideLoading(); if(!coming||F.isActive===false){ return; } if(false===F.trigger('afterLoad', coming, previous)){ coming.wrap.stop(true).trigger('onReset').remove(); F.coming=null; return; } if(previous){ F.trigger('beforeChange', previous); previous.wrap.stop(true).removeClass('fancybox-opened') .find('.fancybox-item, .fancybox-nav') .remove(); } F.unbindEvents(); current=coming; content=coming.content; type=coming.type; scrolling=coming.scrolling; $.extend(F, { wrap:current.wrap, skin:current.skin, outer:current.outer, inner:current.inner, current:current, previous:previous }); href=current.href; switch (type){ case 'inline': case 'ajax': case 'html': if(current.selector){ content=$('
').html(content).find(current.selector); }else if(isQuery(content)){ if(!content.data(placeholder)){ content.data(placeholder, $('
').insertAfter(content).hide()); } content=content.show().detach(); current.wrap.bind('onReset', function (){ if($(this).find(content).length){ content.hide().replaceAll(content.data(placeholder)).data(placeholder, false); }}); } break; case 'image': content=current.tpl.image.replace('{href}', href); break; case 'swf': content=''; embed=''; $.each(current.swf, function(name, val){ content +=''; embed +=' ' + name + '="' + val + '"'; }); content +=''; break; } if(!(isQuery(content)&&content.parent().is(current.inner))){ current.inner.append(content); } F.trigger('beforeShow'); current.inner.css('overflow', scrolling==='yes' ? 'scroll':(scrolling==='no' ? 'hidden':scrolling)); F._setDimension(); F.reposition(); F.isOpen=false; F.coming=null; F.bindEvents(); if(!F.isOpened){ $('.fancybox-wrap').not(current.wrap).stop(true).trigger('onReset').remove(); }else if(previous.prevMethod){ F.transitions[ previous.prevMethod ](); } F.transitions[ F.isOpened ? current.nextMethod:current.openMethod ](); F._preloadImages(); }, _setDimension: function (){ var viewport=F.getViewport(), steps=0, canShrink=false, canExpand=false, wrap=F.wrap, skin=F.skin, inner=F.inner, current=F.current, width=current.width, height=current.height, minWidth=current.minWidth, minHeight=current.minHeight, maxWidth=current.maxWidth, maxHeight=current.maxHeight, scrolling=current.scrolling, scrollOut=current.scrollOutside ? current.scrollbarWidth:0, margin=current.margin, wMargin=getScalar(margin[1] + margin[3]), hMargin=getScalar(margin[0] + margin[2]), wPadding, hPadding, wSpace, hSpace, origWidth, origHeight, origMaxWidth, origMaxHeight, ratio, width_, height_, maxWidth_, maxHeight_, iframe, body; wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); wPadding=getScalar(skin.outerWidth(true) - skin.width()); hPadding=getScalar(skin.outerHeight(true) - skin.height()); wSpace=wMargin + wPadding; hSpace=hMargin + hPadding; origWidth=isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100:width; origHeight=isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100:height; if(current.type==='iframe'){ iframe=current.content; if(current.autoHeight&&iframe.data('ready')===1){ try { if(iframe[0].contentWindow.document.location){ inner.width(origWidth).height(9999); body=iframe.contents().find('body'); if(scrollOut){ body.css('overflow-x', 'hidden'); } origHeight=body.outerHeight(true); }} catch (e){}} }else if(current.autoWidth||current.autoHeight){ inner.addClass('fancybox-tmp'); if(!current.autoWidth){ inner.width(origWidth); } if(!current.autoHeight){ inner.height(origHeight); } if(current.autoWidth){ origWidth=inner.width(); } if(current.autoHeight){ origHeight=inner.height(); } inner.removeClass('fancybox-tmp'); } width=getScalar(origWidth); height=getScalar(origHeight); ratio=origWidth / origHeight; minWidth=getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace:minWidth); maxWidth=getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace:maxWidth); minHeight=getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace:minHeight); maxHeight=getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace:maxHeight); origMaxWidth=maxWidth; origMaxHeight=maxHeight; if(current.fitToView){ maxWidth=Math.min(viewport.w - wSpace, maxWidth); maxHeight=Math.min(viewport.h - hSpace, maxHeight); } maxWidth_=viewport.w - wMargin; maxHeight_=viewport.h - hMargin; if(current.aspectRatio){ if(width > maxWidth){ width=maxWidth; height=getScalar(width / ratio); } if(height > maxHeight){ height=maxHeight; width=getScalar(height * ratio); } if(width < minWidth){ width=minWidth; height=getScalar(width / ratio); } if(height < minHeight){ height=minHeight; width=getScalar(height * ratio); }}else{ width=Math.max(minWidth, Math.min(width, maxWidth)); if(current.autoHeight&¤t.type!=='iframe'){ inner.width(width); height=inner.height(); } height=Math.max(minHeight, Math.min(height, maxHeight)); } if(current.fitToView){ inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); if(current.aspectRatio){ while ((width_ > maxWidth_||height_ > maxHeight_)&&width > minWidth&&height > minHeight){ if(steps++ > 19){ break; } height=Math.max(minHeight, Math.min(maxHeight, height - 10)); width=getScalar(height * ratio); if(width < minWidth){ width=minWidth; height=getScalar(width / ratio); } if(width > maxWidth){ width=maxWidth; height=getScalar(width / ratio); } inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); }}else{ width=Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); height=Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); }} if(scrollOut&&scrolling==='auto'&&height < origHeight&&(width + wPadding + scrollOut) < maxWidth_){ width +=scrollOut; } inner.width(width).height(height); wrap.width(width + wPadding); width_=wrap.width(); height_=wrap.height(); canShrink=(width_ > maxWidth_||height_ > maxHeight_)&&width > minWidth&&height > minHeight; canExpand=current.aspectRatio ? (width < origMaxWidth&&height < origMaxHeight&&width < origWidth&&height < origHeight):((width < origMaxWidth||height < origMaxHeight)&&(width < origWidth||height < origHeight)); $.extend(current, { dim:{ width:getValue(width_), height:getValue(height_) }, origWidth:origWidth, origHeight:origHeight, canShrink:canShrink, canExpand:canExpand, wPadding:wPadding, hPadding:hPadding, wrapSpace:height_ - skin.outerHeight(true), skinSpace:skin.height() - height }); if(!iframe&¤t.autoHeight&&height > minHeight&&height < maxHeight&&!canExpand){ inner.height('auto'); }}, _getPosition: function (onlyAbsolute){ var current=F.current, viewport=F.getViewport(), margin=current.margin, width=F.wrap.width() + margin[1] + margin[3], height=F.wrap.height() + margin[0] + margin[2], rez={ position: 'absolute', top:margin[0], left:margin[3] }; if(current.autoCenter&¤t.fixed&&!onlyAbsolute&&height <=viewport.h&&width <=viewport.w){ rez.position='fixed'; }else if(!current.locked){ rez.top +=viewport.y; rez.left +=viewport.x; } rez.top=getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); rez.left=getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); return rez; }, _afterZoomIn: function (){ var current=F.current; if(!current){ return; } F.isOpen=F.isOpened=true; F.wrap.css('overflow', 'visible').addClass('fancybox-opened'); F.update(); if(current.closeClick||(current.nextClick&&F.group.length > 1)){ F.inner.css('cursor', 'pointer').bind('click.fb', function(e){ if(!$(e.target).is('a')&&!$(e.target).parent().is('a')){ e.preventDefault(); F[ current.closeClick ? 'close':'next' ](); }}); } if(current.closeBtn){ $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e){ e.preventDefault(); F.close(); }); } if(current.arrows&&F.group.length > 1){ if(current.loop||current.index > 0){ $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); } if(current.loop||current.index < F.group.length - 1){ $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); }} F.trigger('afterShow'); if(!current.loop&¤t.index===current.group.length - 1){ F.play(false); }else if(F.opts.autoPlay&&!F.player.isActive){ F.opts.autoPlay=false; F.play(); }}, _afterZoomOut: function(obj){ obj=obj||F.current; $('.fancybox-wrap').trigger('onReset').remove(); $.extend(F, { group:{}, opts:{}, router:false, current:null, isActive:false, isOpened:false, isOpen:false, isClosing:false, wrap:null, skin:null, outer:null, inner:null }); F.trigger('afterClose', obj); }}); F.transitions={ getOrigPosition: function (){ var current=F.current, element=current.element, orig=current.orig, pos={}, width=50, height=50, hPadding=current.hPadding, wPadding=current.wPadding, viewport=F.getViewport(); if(!orig&¤t.isDom&&element.is(':visible')){ orig=element.find('img:first'); if(!orig.length){ orig=element; }} if(isQuery(orig)){ pos=orig.offset(); if(orig.is('img')){ width=orig.outerWidth(); height=orig.outerHeight(); }}else{ pos.top=viewport.y + (viewport.h - height) * current.topRatio; pos.left=viewport.x + (viewport.w - width) * current.leftRatio; } if(F.wrap.css('position')==='fixed'||current.locked){ pos.top -=viewport.y; pos.left -=viewport.x; } pos={ top:getValue(pos.top - hPadding * current.topRatio), left:getValue(pos.left - wPadding * current.leftRatio), width:getValue(width + wPadding), height:getValue(height + hPadding) }; return pos; }, step: function (now, fx){ var ratio, padding, value, prop=fx.prop, current=F.current, wrapSpace=current.wrapSpace, skinSpace=current.skinSpace; if(prop==='width'||prop==='height'){ ratio=fx.end===fx.start ? 1:(now - fx.start) / (fx.end - fx.start); if(F.isClosing){ ratio=1 - ratio; } padding=prop==='width' ? current.wPadding:current.hPadding; value=now - padding; F.skin[ prop ](getScalar(prop==='width' ? value:value - (wrapSpace * ratio))); F.inner[ prop ](getScalar(prop==='width' ? value:value - (wrapSpace * ratio) - (skinSpace * ratio))); }}, zoomIn: function (){ var current=F.current, startPos=current.pos, effect=current.openEffect, elastic=effect==='elastic', endPos=$.extend({opacity:1}, startPos); delete endPos.position; if(elastic){ startPos=this.getOrigPosition(); if(current.openOpacity){ startPos.opacity=0.1; }}else if(effect==='fade'){ startPos.opacity=0.1; } F.wrap.css(startPos).animate(endPos, { duration:effect==='none' ? 0:current.openSpeed, easing:current.openEasing, step:elastic ? this.step:null, complete:F._afterZoomIn }); }, zoomOut: function (){ var current=F.current, effect=current.closeEffect, elastic=effect==='elastic', endPos={opacity:0.1}; if(elastic){ endPos=this.getOrigPosition(); if(current.closeOpacity){ endPos.opacity=0.1; }} F.wrap.animate(endPos, { duration:effect==='none' ? 0:current.closeSpeed, easing:current.closeEasing, step:elastic ? this.step:null, complete:F._afterZoomOut }); }, changeIn: function (){ var current=F.current, effect=current.nextEffect, startPos=current.pos, endPos={ opacity:1 }, direction=F.direction, distance=200, field; startPos.opacity=0.1; if(effect==='elastic'){ field=direction==='down'||direction==='up' ? 'top':'left'; if(direction==='down'||direction==='right'){ startPos[ field ]=getValue(getScalar(startPos[ field ]) - distance); endPos[ field ]='+=' + distance + 'px'; }else{ startPos[ field ]=getValue(getScalar(startPos[ field ]) + distance); endPos[ field ]='-=' + distance + 'px'; }} if(effect==='none'){ F._afterZoomIn(); }else{ F.wrap.css(startPos).animate(endPos, { duration:current.nextSpeed, easing:current.nextEasing, complete:F._afterZoomIn }); }}, changeOut: function (){ var previous=F.previous, effect=previous.prevEffect, endPos={ opacity:0.1 }, direction=F.direction, distance=200; if(effect==='elastic'){ endPos[ direction==='down'||direction==='up' ? 'top':'left' ]=(direction==='up'||direction==='left' ? '-':'+') + '=' + distance + 'px'; } previous.wrap.animate(endPos, { duration:effect==='none' ? 0:previous.prevSpeed, easing:previous.prevEasing, complete:function (){ $(this).trigger('onReset').remove(); }}); }}; F.helpers.overlay={ defaults:{ closeClick:true, speedOut:200, showEarly:true, css:{}, locked:!isTouch, fixed:true }, overlay:null, fixed:false, el:$('html'), create:function(opts){ opts=$.extend({}, this.defaults, opts); if(this.overlay){ this.close(); } this.overlay=$('
').appendTo(F.coming ? F.coming.parent:opts.parent); this.fixed=false; if(opts.fixed&&F.defaults.fixed){ this.overlay.addClass('fancybox-overlay-fixed'); this.fixed=true; }}, open:function(opts){ var that=this; opts=$.extend({}, this.defaults, opts); if(this.overlay){ this.overlay.unbind('.overlay').width('auto').height('auto'); }else{ this.create(opts); } if(!this.fixed){ W.bind('resize.overlay', $.proxy(this.update, this)); this.update(); } if(opts.closeClick){ this.overlay.bind('click.overlay', function(e){ if($(e.target).hasClass('fancybox-overlay')){ if(F.isActive){ F.close(); }else{ that.close(); } return false; }}); } this.overlay.css(opts.css).show(); }, close:function(){ var scrollV, scrollH; W.unbind('resize.overlay'); if(this.el.hasClass('fancybox-lock')){ $('.fancybox-margin').removeClass('fancybox-margin'); scrollV=W.scrollTop(); scrollH=W.scrollLeft(); this.el.removeClass('fancybox-lock'); W.scrollTop(scrollV).scrollLeft(scrollH); } $('.fancybox-overlay').remove().hide(); $.extend(this, { overlay:null, fixed:false }); }, update:function (){ var width='100%', offsetWidth; this.overlay.width(width).height('100%'); if(IE){ offsetWidth=Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); if(D.width() > offsetWidth){ width=D.width(); }}else if(D.width() > W.width()){ width=D.width(); } this.overlay.width(width).height(D.height()); }, onReady:function (opts, obj){ var overlay=this.overlay; $('.fancybox-overlay').stop(true, true); if(!overlay){ this.create(opts); } if(opts.locked&&this.fixed&&obj.fixed){ if(!overlay){ this.margin=D.height() > W.height() ? $('html').css('margin-right').replace("px", ""):false; } obj.locked=this.overlay.append(obj.wrap); obj.fixed=false; } if(opts.showEarly===true){ this.beforeShow.apply(this, arguments); }}, beforeShow:function(opts, obj){ var scrollV, scrollH; if(obj.locked){ if(this.margin!==false){ $('*').filter(function(){ return ($(this).css('position')==='fixed'&&!$(this).hasClass("fancybox-overlay")&&!$(this).hasClass("fancybox-wrap")); }).addClass('fancybox-margin'); this.el.addClass('fancybox-margin'); } scrollV=W.scrollTop(); scrollH=W.scrollLeft(); this.el.addClass('fancybox-lock'); W.scrollTop(scrollV).scrollLeft(scrollH); } this.open(opts); }, onUpdate:function(){ if(!this.fixed){ this.update(); }}, afterClose: function (opts){ if(this.overlay&&!F.coming){ this.overlay.fadeOut(opts.speedOut, $.proxy(this.close, this)); }} }; F.helpers.title={ defaults:{ type:'float', // 'float', 'inside', 'outside' or 'over', position:'bottom' // 'top' or 'bottom' }, beforeShow: function (opts){ var current=F.current, text=current.title, type=opts.type, title, target; if($.isFunction(text)){ text=text.call(current.element, current); } if(!isString(text)||$.trim(text)===''){ return; } title=$('
' + text + '
'); switch (type){ case 'inside': target=F.skin; break; case 'outside': target=F.wrap; break; case 'over': target=F.inner; break; default: // 'float' target=F.skin; title.appendTo('body'); if(IE){ title.width(title.width()); } title.wrapInner(''); F.current.margin[2] +=Math.abs(getScalar(title.css('margin-bottom'))); break; } title[ (opts.position==='top' ? 'prependTo':'appendTo') ](target); }}; $.fn.fancybox=function (options){ var index, that=$(this), selector=this.selector||'', run=function(e){ var what=$(this).blur(), idx=index, relType, relVal; if(!(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&!what.is('.fancybox-wrap')){ relType=options.groupAttr||'data-fancybox-group'; relVal=what.attr(relType); if(!relVal){ relType='rel'; relVal=what.get(0)[ relType ]; } if(relVal&&relVal!==''&&relVal!=='nofollow'){ what=selector.length ? $(selector):that; what=what.filter('[' + relType + '="' + relVal + '"]'); idx=what.index(this); } options.index=idx; if(F.open(what, options)!==false){ e.preventDefault(); }} }; options=options||{}; index=options.index||0; if(!selector||options.live===false){ that.unbind('click.fb-start').bind('click.fb-start', run); }else{ D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); } this.filter('[data-fancybox-start=1]').trigger('click'); return this; }; D.ready(function(){ var w1, w2; if($.scrollbarWidth===undefined){ $.scrollbarWidth=function(){ var parent=$('
').appendTo('body'), child=parent.children(), width=child.innerWidth() - child.height(99).innerWidth(); parent.remove(); return width; };} if($.support.fixedPosition===undefined){ $.support.fixedPosition=(function(){ var elem=$('
').appendTo('body'), fixed=(elem[0].offsetTop===20||elem[0].offsetTop===15); elem.remove(); return fixed; }()); } $.extend(F.defaults, { scrollbarWidth:$.scrollbarWidth(), fixed:$.support.fixedPosition, parent:$('body') }); w1=$(window).width(); H.addClass('fancybox-lock-test'); w2=$(window).width(); H.removeClass('fancybox-lock-test'); $("").appendTo("head"); }); }(window, document, jQuery));